diff --git a/app/common/repositories/store/order/StoreGroupOrderRepository.php b/app/common/repositories/store/order/StoreGroupOrderRepository.php index 33ce0de3..53e7fc25 100644 --- a/app/common/repositories/store/order/StoreGroupOrderRepository.php +++ b/app/common/repositories/store/order/StoreGroupOrderRepository.php @@ -67,7 +67,13 @@ class StoreGroupOrderRepository extends BaseRepository $query->field('order_id,group_order_id,activity_type,pay_price,status,mer_id')->with(['merchant' => function ($query) { $query->field('mer_id,mer_name,settle_cycle,interest_rate'); }, 'orderProduct','presellOrder']); - }])->page($page, $limit)->order('create_time DESC')->select(); + }, 'interest'])->page($page, $limit)->order('create_time DESC')->select(); + foreach ($list as $k => $item) { + if (is_callable([$item->interest, 'calculateInterest'])) { + $interest = $item->interest->calculateInterest(); + $list[$k]['interest']['total_amount'] = bcadd($item->interest->total_price, $interest, 2); + } + } return compact('count', 'list'); }