Browse Source

质押列表

afa 4 months ago
parent
commit
80ae734cb7
2 changed files with 6 additions and 2 deletions
  1. 1 1
      application/api/controller/Pledge.php
  2. 5 1
      application/api/logic/PledgeLogic.php

+ 1 - 1
application/api/controller/Pledge.php

@@ -37,7 +37,7 @@ class Pledge extends Api
                   ->where('status', $productPledges::Normal)
                   ->where('to_lang', $this->lan)->where('type_id', $type_id)
                   ->field('id,title,day_num,income_reta,product_id,type_id')
-                  ->order('weigh desc')
+                  ->order('weigh desc,id desc')
                   ->paginate($this->pageSize);
 
             $list = $pledgeLogic::getByProductIdList($list, $this->lan);  

+ 5 - 1
application/api/logic/PledgeLogic.php

@@ -131,18 +131,22 @@ class PledgeLogic
         $reta  = bcdiv($rows->day_num, $day, 6); //天数
         $total = 0; 
         //到期解除收取
+
+        
         if($time > $rows->end_time){
+            dump(111);die;
             $inter = ($rows->last_time == 0) ? $rows->end_time - $rows->create_time: $rows->end_time - $rows->last_time; //最后收取时间
             $rows->total_self= bcmul($reta, $inter, 6) * $num; //累计收益
             $rows->status = $model::Close;   //更新领取状态
             Loader::model('LedgerWalletModel')->changeWalletAccount($user_id, Asset::TEAC, $rows->total_self, LedgerTeacChangeModel::Pledge, 0);  
         }else{
-
+         
             $inter = ($rows->last_time == 0) ? $time - $rows->create_time: $time - $rows->last_time; //最后收取时间
             $total = bcmul($reta, $inter, 6) * $num; //累计收益
             $rows->total_self= ($rows->status  == $model::Remove)? $total: bcadd($total, $rows->total_self, 6);
         }
   
+           dump($rows->status );die;
         //修改状态
         Loader::model('ProductOrder')::where('user_id', $user_id)->whereIn('id', $orderId)->setField('status', ProductOrder::Paid);