diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index a98521e58..e1bc72826 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -75,8 +75,10 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte default: break; } - if (!empty($this->params['store_staff_id'])) { + if (!empty($this->params['store_staff_id']) || !empty($this->params['is_store'])) { $this->searchWhere[] = ['store_staff_id', '>', 0]; + } else { + $this->searchWhere[] = ['store_staff_id', '=', 0]; } if ($order_rk!='') { $oid=WarehouseOrder::where('financial_pm',1)->where('code','like','%'.$order_rk)->column('id'); diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index b12a578dc..13ad4ad0a 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -438,6 +438,7 @@ class BeforehandOrderLogic extends BaseLogic WarehouseOrder::where('id', $res['id'])->update(['total_price' => $totalPrice, 'nums' => $finds['nums']]); $order->save(['outbound_id' => $res['id'], 'is_outbound' => 1, 'pay_price' => $totalPrice]); BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->update(['is_buyer' => -1]); + self::confirm(['id' => $params['bhoid']]); Db::commit(); return true; } catch (\Throwable $e) { @@ -1003,6 +1004,13 @@ class BeforehandOrderLogic extends BaseLogic if ($params['store_id'] > 0) { $where2[] = ['store_id', '=', $params['store_id']]; } + if (!empty($params['is_store'])) { + $where[] = ['store_staff_id', '>', 0]; + $where2[] = ['store_staff_id', '>', 0]; + } else { + $where[] = ['store_staff_id', '=', 0]; + $where2[] = ['store_staff_id', '=', 0]; + } if ($params['start_time'] != '' && $params['end_time'] != '') { $where2[] = ['create_time', 'between', [strtotime($params['start_time']), strtotime($params['end_time'])]]; } diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 1defced89..d74df2910 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -280,8 +280,9 @@ class BeforehandOrderCartInfoLogic extends BaseLogic PurchaseProductOffer::where('order_id',$find['bhoid'])->where('product_id',$find['product_id'])->update(['delete_time'=>time()]); } $res=BeforehandOrderCartInfo::destroy($params['id']); - $pay_price=BeforehandOrderCartInfo::where('bhoid', $params['id'])->sum('pay_price'); - BeforehandOrder::where('id',$find['bhoid'])->update(['pay_price'=>$pay_price]); + $pay_price=BeforehandOrderCartInfo::where('bhoid', $find['bhoid'])->sum('pay_price'); + $total_price=BeforehandOrderCartInfo::where('bhoid', $find['bhoid'])->sum('total_price'); + BeforehandOrder::where('id',$find['bhoid'])->update(['pay_price'=>$pay_price, 'total_price'=>$total_price]); return $res; }