|
|
@@ -111,7 +111,7 @@ class PledgeLogic
|
|
|
->field('a.*,b.day_num')
|
|
|
->find();
|
|
|
if(empty($rows)) throw new Exception('暂无质押订单');
|
|
|
-
|
|
|
+
|
|
|
$orderId = explode(',', $order_id);
|
|
|
$detail = json_decode($rows->details, true);
|
|
|
$count = count($orderId);
|
|
|
@@ -119,9 +119,15 @@ class PledgeLogic
|
|
|
if(count($orderId) == count($detail)) {
|
|
|
$rows->status = $model::Remove;
|
|
|
}else{
|
|
|
- $rows->num = count($detail) - $count;
|
|
|
+
|
|
|
+ $result = [];
|
|
|
+ foreach ($detail as &$item)
|
|
|
+ if(!in_array($item['id'], $orderId)) $result[] = $item;
|
|
|
$num = $count;
|
|
|
+ $rows->num = count($result);
|
|
|
+ $rows->details = json_encode($result, JSON_UNESCAPED_UNICODE);
|
|
|
}
|
|
|
+
|
|
|
$day = 86400;
|
|
|
$total = 0; //当前累计收益
|
|
|
$reta = bcdiv($rows->day_num, $day, 6); //天数
|
|
|
@@ -155,8 +161,7 @@ class PledgeLogic
|
|
|
if(empty($list)) throw new Exception('暂无质押订单');
|
|
|
$day = 86400;
|
|
|
$total = 0; //当前累计收益
|
|
|
- foreach ($list as $item)
|
|
|
- {
|
|
|
+ foreach ($list as $item) {
|
|
|
//解冻
|
|
|
if($item->status == $model::Remove) {
|
|
|
$total += $item->total_self;
|
|
|
@@ -185,7 +190,6 @@ class PledgeLogic
|
|
|
|
|
|
$pledge->end_time = $pledge->end_time + config('pledge_end_time');
|
|
|
return $pledge->save();
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|