diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index e5d8f2251..48e3abef4 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -12,6 +12,7 @@ use app\common\model\system_store\SystemStore; use app\common\lists\ListsExcelInterface; use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo; use app\common\model\store_order\StoreOrder; +use app\common\model\system_store\SystemStoreStaff; use app\common\model\warehouse_order\WarehouseOrder; use app\common\model\warehouse_product\WarehouseProduct; @@ -33,7 +34,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte public function setSearch(): array { return [ - '=' => ['store_id', 'paid', 'status', 'order_type', 'admin_id'], + '=' => ['store_id', 'paid', 'status', 'order_type', 'admin_id', 'store_staff_id'], '%like' => ['order_id','order_sn'], '%like%' => ['mark'], 'between_time' => 'create_time' @@ -81,8 +82,9 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte $oid=WarehouseOrder::where('financial_pm',0)->where('code','like','%'.$order_ck)->column('id'); $this->searchWhere[] = ['outbound_id','in',$oid]; } - $file=['id','uid', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file','other_data', 'audit_status']; - return BeforehandOrder::where($this->searchWhere) + $file=['id','uid', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file','other_data', 'audit_status', 'store_staff_id']; + $query = BeforehandOrder::where($this->searchWhere); + return $query ->field($file) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -94,6 +96,9 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte } else { $item->admin_name = ''; } + if ($item->store_staff_id) { + $item->admin_name = SystemStoreStaff::where(['id' => $item->store_staff_id])->value('staff_name'); + } if ($item->order_type == 1) { $item->order_type_name = '铺货订单'; } elseif ($item->order_type == 2) { diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 0dbac1f3d..13c5e4117 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -112,6 +112,7 @@ class BeforehandOrderLogic extends BaseLogic $order = BeforehandOrder::create([ 'order_id' => getNewOrderId('YG'), 'admin_id' => $params['admin_id'] ?? 0, + 'store_staff_id' => $params['store_staff_id'] ?? 0, 'store_id' => $params['store_id'] ?? 0, 'uid' => $uid, 'total_num' => $total_num, diff --git a/app/store/controller/beforehand_order/BeforehandOrderController.php b/app/store/controller/beforehand_order/BeforehandOrderController.php index 9f5002491..9d39c2276 100644 --- a/app/store/controller/beforehand_order/BeforehandOrderController.php +++ b/app/store/controller/beforehand_order/BeforehandOrderController.php @@ -39,7 +39,7 @@ class BeforehandOrderController extends BaseAdminController { $params = $this->request->get(); $params['store_id'] = $this->request->adminInfo['store_id'] ?? 0; - $params['admin_id'] = $this->request->adminInfo['admin_id'] ?? 0; + $params['store_staff_id'] = $this->request->adminInfo['admin_id'] ?? 0; $this->request->setGet($params); return $this->dataLists(new BeforehandOrderLists()); } @@ -63,7 +63,7 @@ class BeforehandOrderController extends BaseAdminController public function add() { $params = $this->request->post(); - $params['admin_id'] = $this->adminId; + $params['store_staff_id'] = $this->adminId; $params['store_id'] = $this->request->adminInfo['store_id'] ?? 0; $other_data = [ 'nickname' => $params['nickname'] ?? '',