feat: 完善订单列表接口

master
yin5th 2023-08-15 15:08:11 +08:00
parent 4bafdb2687
commit 0225c18ba8
1 changed files with 4 additions and 3 deletions

View File

@ -922,7 +922,7 @@ class OrderLogic extends Logic
$order_data['distribution_money'] = 0;
$order_data['coupon_list_id'] = $coupon_list_id;
$order_data['create_time'] = time();
$order_create = $Order->create($order_data);
if (false === $order_create) {
@ -1177,14 +1177,14 @@ class OrderLogic extends Logic
$lists = $order->where(['del' => 0, 'user_id' => $user_id])
->where($where)
->with(['order_goods', 'shop'])
->field('id,order_sn,order_status,pay_status,order_amount,order_status,order_type,shipping_status,create_time,shop_id,delivery_type')
->field('id,order_sn,order_status,pay_status,order_amount,order_status,order_type,shipping_status,create_time,shop_id,delivery_type,frontend_info,is_frontend')
->page($page, $size)
->order('id desc')
->select();
$lists->append(['goods_count', 'pay_btn', 'cancel_btn', 'delivery_btn', 'take_btn', 'del_btn', 'comment_btn', 'content_btn','order_cancel_time']);
foreach ($lists as $list) {
foreach ($lists as $k => $list) {
if ($list['order_type'] == OrderEnum::SECKILL_ORDER) {//如果是秒杀
foreach ($list['order_goods'] as $item) {
$seckill_price = GoodsItem::isSeckill($item['item_id']);
@ -1193,6 +1193,7 @@ class OrderLogic extends Logic
}
}
}
$lists[$k]['frontend_array'] = explode(',', $list['frontend_info']);
}
$data = [
'list' => $lists,