修改门店预订单查询

This commit is contained in:
lewis 2025-01-11 16:52:14 +08:00
parent f485c956df
commit 5d73af5719
3 changed files with 11 additions and 5 deletions

View File

@ -12,6 +12,7 @@ use app\common\model\system_store\SystemStore;
use app\common\lists\ListsExcelInterface; use app\common\lists\ListsExcelInterface;
use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo; use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo;
use app\common\model\store_order\StoreOrder; 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_order\WarehouseOrder;
use app\common\model\warehouse_product\WarehouseProduct; use app\common\model\warehouse_product\WarehouseProduct;
@ -33,7 +34,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
public function setSearch(): array public function setSearch(): array
{ {
return [ 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' => ['order_id','order_sn'],
'%like%' => ['mark'], '%like%' => ['mark'],
'between_time' => 'create_time' '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'); $oid=WarehouseOrder::where('financial_pm',0)->where('code','like','%'.$order_ck)->column('id');
$this->searchWhere[] = ['outbound_id','in',$oid]; $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']; $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'];
return BeforehandOrder::where($this->searchWhere) $query = BeforehandOrder::where($this->searchWhere);
return $query
->field($file) ->field($file)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
@ -94,6 +96,9 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
} else { } else {
$item->admin_name = ''; $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) { if ($item->order_type == 1) {
$item->order_type_name = '铺货订单'; $item->order_type_name = '铺货订单';
} elseif ($item->order_type == 2) { } elseif ($item->order_type == 2) {

View File

@ -112,6 +112,7 @@ class BeforehandOrderLogic extends BaseLogic
$order = BeforehandOrder::create([ $order = BeforehandOrder::create([
'order_id' => getNewOrderId('YG'), 'order_id' => getNewOrderId('YG'),
'admin_id' => $params['admin_id'] ?? 0, 'admin_id' => $params['admin_id'] ?? 0,
'store_staff_id' => $params['store_staff_id'] ?? 0,
'store_id' => $params['store_id'] ?? 0, 'store_id' => $params['store_id'] ?? 0,
'uid' => $uid, 'uid' => $uid,
'total_num' => $total_num, 'total_num' => $total_num,

View File

@ -39,7 +39,7 @@ class BeforehandOrderController extends BaseAdminController
{ {
$params = $this->request->get(); $params = $this->request->get();
$params['store_id'] = $this->request->adminInfo['store_id'] ?? 0; $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); $this->request->setGet($params);
return $this->dataLists(new BeforehandOrderLists()); return $this->dataLists(new BeforehandOrderLists());
} }
@ -63,7 +63,7 @@ class BeforehandOrderController extends BaseAdminController
public function add() public function add()
{ {
$params = $this->request->post(); $params = $this->request->post();
$params['admin_id'] = $this->adminId; $params['store_staff_id'] = $this->adminId;
$params['store_id'] = $this->request->adminInfo['store_id'] ?? 0; $params['store_id'] = $this->request->adminInfo['store_id'] ?? 0;
$other_data = [ $other_data = [
'nickname' => $params['nickname'] ?? '', 'nickname' => $params['nickname'] ?? '',