Browse Source

质抵押订单

afa 7 months ago
parent
commit
34b09adb82
1 changed files with 4 additions and 4 deletions
  1. 4 4
      application/common/logic/PledgeLogic.php

+ 4 - 4
application/common/logic/PledgeLogic.php

@@ -79,7 +79,7 @@ class PledgeLogic
         foreach ($list as $item) {
            $reta  = bcdiv($item->day_num, $day, 6); //天
            $inter = ($item->last_time == 0) ? $time - $item->create_time: $time - $item->last_time; //最后收取时间
-           $total += bcmul($reta, $inter)* $item->num; //累计收益
+           $total += bcmul($reta, $inter, 6)* $item->num; //累计收益
            $growth += $reta* $item->num;
         }
         return ['total' => $total, 'growth' => $growth, 'list' => $list];   
@@ -94,10 +94,10 @@ class PledgeLogic
         $day   = 86400;
         $total = 0; //当前累计收益
         $time  = time();
-        $reta  = bcdiv($rows->day_num, $day, 2); //天数
+        $reta  = bcdiv($rows->day_num, $day, 6); //天数
         $inter = ($rows->last_time == 0) ? $time - $rows->create_time: $time - $rows->last_time; //最后收取时间
-        $total = bcmul($reta, $inter, 2) * $rows->num; //累计收益
-        $rows->total_self= bcadd($total, $rows->total_self, 2);
+        $total = bcmul($reta, $inter, 6) * $rows->num; //累计收益
+        $rows->total_self= bcadd($total, $rows->total_self, 6);
 
         $model->whereIn('order_no', $rows->order_no)->setField('status', $model::Paid);