Browse Source

等于0的不发

jason 6 months ago
parent
commit
b29271ae51
1 changed files with 5 additions and 7 deletions
  1. 5 7
      application/api/controller/Index.php

+ 5 - 7
application/api/controller/Index.php

@@ -35,10 +35,7 @@ class Index extends Api
             $day   = 86400;
             foreach ($list as $item) {
                
-                if($item->status == 2) {
-                    //解除收益
-                    $total = $item->total_self;
-                }else{
+                if($item->status == 1) {
                     //未接触收益
                     $reta  = bcdiv($item->day_num, $day, 6); //天数
                     $inter = ($item->last_time == 0) ? $time - $item->create_time: $time - $item->last_time; //最后收取时间
@@ -48,9 +45,10 @@ class Index extends Api
                     $total = $total_inco; //累计收益
                 }
            
-                
-                //更新用户资产
-                $ledgerWalletModel->changeWalletAccount($item->user_id, Asset::TEAC, $total, LedgerTeacChangeModel::Pledge, 0);  
+                if($total > 0){
+                    //更新用户资产
+                    $ledgerWalletModel->changeWalletAccount($item->user_id, Asset::TEAC, $total, LedgerTeacChangeModel::Pledge, 0);
+                }
 
                 //修改详情订单状态
                 $detail = json_decode($item['details'], true);