afa 7 mesiacov pred
rodič
commit
4a1f3748e4
1 zmenil súbory, kde vykonal 4 pridanie a 5 odobranie
  1. 4 5
      application/common/logic/PledgeLogic.php

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

@@ -71,16 +71,15 @@ class PledgeLogic
             ->where('a.status', $model::Ongoing)
             ->field('a.*,b.title')
             ->select();
-
         if(empty($list))  throw new Exception('暂无质押订单');
         $day   = 86400;
         $total = 0; //当前累计收益
         $growth= 0; //增长累计收益
         $time  = time();
         foreach ($list as $item) {
-           $reta  = bcdiv($item->day_num, $day, 2); //天数
+           $reta  = bcdiv($item->day_num, $day, 6); //天
            $inter = ($item->last_time == 0) ? $time - $item->create_time: $time - $item->last_time; //最后收取时间
-           $total += bcmul($reta, $inter, 2)* $item->num; //累计收益
+           $total += bcmul($reta, $inter)* $item->num; //累计收益
            $growth += $reta* $item->num;
         }
         return ['total' => $total, 'growth' => $growth, 'list' => $list];   
@@ -125,9 +124,9 @@ class PledgeLogic
                 $total = $item->total_self;
                 $item->status = $model::Close; //关闭
             }else{
-                $reta  = bcdiv($item->day_num, $day, 2); //天数
+                $reta  = bcdiv($item->day_num, $day, 6); //天数
                 $inter = ($item->last_time == 0) ? $time - $item->create_time: $time - $item->last_time; //最后收取时间
-                $total = bcmul($reta, $inter, 2) * $item->num; //累计收益
+                $total = bcmul($reta, $inter, 6) * $item->num; //累计收益
                 $item->last_time = $time; //收取时间
                 $item->total_self= bcadd($total, $item->total_self, 2); //累计收益
             }