Przeglądaj źródła

Merge branch 'master' of https://git.hxiaoju.top/Teapay/RWACha-API

afa 6 miesięcy temu
rodzic
commit
dd37f96601

+ 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; //最后收取时间
@@ -49,9 +46,10 @@ class Index extends Api
                     
                 }
            
-                
-                //更新用户资产
-                $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);

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

@@ -56,6 +56,7 @@ class Pledge extends Api
             if (!empty($pledges)) {
                   $pledges->product_list = $productList::getBySynthesisProduct($pledges->product_id,  $pledges->type_id, $this->lan);
             }
+            $pledges['day_num'] = round($pledges['day_num'], 2);
             $this->success('', $pledges);
       }
 

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

@@ -26,6 +26,7 @@ class PledgeLogic
             $item['product_list'] = $model->whereIn('id', $item->product_id);
             if($item->type_id == ProductPledges::Combin) $item['product_list'] = $model->orderRaw('field(id,'. $item->product_id.')');
             $item['product_list'] = $model->field('id,thum,'.$lan.'_name as name')->select();
+            $item['day_num'] = round($item['day_num'], 2);
         }
         return $list;
     }