Browse Source

获取质抵押订单列表

afa 4 months ago
parent
commit
5096112e1b
1 changed files with 4 additions and 3 deletions
  1. 4 3
      application/api/logic/PledgeLogic.php

+ 4 - 3
application/api/logic/PledgeLogic.php

@@ -82,7 +82,8 @@ class PledgeLogic
         $day   = 86400;
         $total = 0; //当前累计收益
         $growth= 0; //增长累计收益
-        foreach ($list as $key=>$item) {
+        $result = [];
+        foreach ($list as $item) {
             if($item->end_time >  $time){
                 if($item->status == $model::Remove) {
                     $total += $item->total_self;
@@ -93,9 +94,9 @@ class PledgeLogic
                     $growth = bcadd($growth, bcmul($reta, $item->num, 6), 6); //增长收益
                 }
             }
-            if($item->status == $model::Remove) unset($list[$key]);
+            if($item->status != $model::Remove) $result[] = $item;
         }
-        return ['total' => $total, 'growth' => $growth, 'list' => $list];   
+        return ['total' => $total, 'growth' => $growth, 'list' => $result];   
     }
 
     //解除质抵押订单