|
|
|
@ -141,6 +141,11 @@ class Order extends OrderModel |
|
|
|
|
$info = $info['storeInfo']->toArray(); |
|
|
|
|
foreach ($list['data'] as &$v) { |
|
|
|
|
$v['storeInfo'] = $info; |
|
|
|
|
$total_num = 0; |
|
|
|
|
foreach ($v['goods'] as $value) { |
|
|
|
|
$total_num += $value['total_num'] ?? 0; |
|
|
|
|
} |
|
|
|
|
$v['total_num'] = $total_num; |
|
|
|
|
$v['delivery'] = DeliveryModel::where('order_id', $v['order_id'])->find(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -491,6 +496,11 @@ class Order extends OrderModel |
|
|
|
|
if (!empty($info['storeInfo'])) { |
|
|
|
|
$order->storeInfo = $info['storeInfo']->toArray(); |
|
|
|
|
} |
|
|
|
|
$total_num = 0; |
|
|
|
|
foreach ($order->goods as $value) { |
|
|
|
|
$total_num += $value->total_num ?? 0; |
|
|
|
|
} |
|
|
|
|
$order->total_num = $total_num; |
|
|
|
|
return $order; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|