更新订单未支付

This commit is contained in:
yaooo 2023-08-19 14:39:53 +08:00
parent 9273590197
commit b4ba19e097

View File

@ -83,13 +83,13 @@ class StoreGroupOrderRepository extends BaseRepository
$query->where('StoreGroupOrder.is_del', 0);
});
$count = $query->count();
$list = $query->with(['orderList' => function (Relation $query) {
$groupList = $query->with(['orderList' => function (Relation $query) {
$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']);
}, 'interest'])->page($page, $limit)->order('create_time DESC')->select();
$return = [];
foreach ($list as $k => $item) {
$list = [];
foreach ($groupList as $k => $item) {
$current = $item->toArray();
if (!empty($item->interest)) {
$interest = $item->interest->calculateInterest();
@ -97,9 +97,9 @@ class StoreGroupOrderRepository extends BaseRepository
} else {
$current['interest']['total_amount'] = $item['total_price'];
}
$return[] = $current;
$list[] = $current;
}
return compact('count', 'return');
return compact('count', 'list');
}
/**