修改门店入库列表查询

This commit is contained in:
lewis 2025-02-15 14:06:16 +08:00
parent 8567f2de4a
commit 36016871da
4 changed files with 9 additions and 5 deletions

View File

@ -27,7 +27,7 @@ class InventoryWarehouseLists extends BaseAdminDataLists implements ListsSearchI
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['product_id'], '=' => ['product_id', 'warehouse_id'],
]; ];
} }

View File

@ -4,6 +4,7 @@ namespace app\admin\lists\warehouse_product;
use app\admin\lists\BaseAdminDataLists; use app\admin\lists\BaseAdminDataLists;
use app\common\model\beforehand_order\BeforehandOrder;
use app\common\model\warehouse_product\WarehouseProduct; use app\common\model\warehouse_product\WarehouseProduct;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\auth\Admin; use app\common\model\auth\Admin;
@ -65,7 +66,7 @@ class StoreWarehouseProductLists extends BaseAdminDataLists implements ListsSear
$this->searchWhere[] = ['financial_pm', '=',0]; $this->searchWhere[] = ['financial_pm', '=',0];
$this->searchWhere[] = ['order_type', 'in',[1, 2, 3, 4, 8]]; $this->searchWhere[] = ['order_type', 'in',[1, 2, 3, 4, 8]];
return WarehouseProduct::where($this->searchWhere) return WarehouseProduct::where($this->searchWhere)
->field(['id', 'admin_id', 'store_id','product_id', 'nums', 'refund_nums', 'status', 'mark', 'create_time',]) ->field(['id', 'admin_id', 'store_id','product_id', 'nums', 'refund_nums', 'status', 'mark', 'create_time', 'order_type'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
// ->withTrashed() // ->withTrashed()
@ -96,6 +97,7 @@ class StoreWarehouseProductLists extends BaseAdminDataLists implements ListsSear
$item->unit_name = StoreProductUnit::where('id', $find->unit)->value('name'); $item->unit_name = StoreProductUnit::where('id', $find->unit)->value('name');
} }
} }
$item->order_type_name = BeforehandOrder::getOrderTypeName($item->order_type);
}) })
->toArray(); ->toArray();
} }

View File

@ -73,7 +73,7 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt
} }
} }
return WarehouseProduct::where($this->searchWhere) return WarehouseProduct::where($this->searchWhere)
->field(['id', 'code','pay_type','oid','admin_id','supplier_id', 'store_id', 'warehouse_id', 'product_id', 'financial_pm', 'batch', 'nums', 'price', 'purchase', 'cost', 'total_price', 'manufacture', 'expiration_date', 'status', 'mark', 'create_time','is_pay']) ->field(['id', 'code','pay_type','oid','admin_id','supplier_id', 'store_id', 'warehouse_id', 'product_id', 'financial_pm', 'batch', 'nums', 'price', 'purchase', 'cost', 'total_price', 'manufacture', 'expiration_date', 'status', 'mark', 'create_time','is_pay', 'order_type'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
// ->withTrashed() // ->withTrashed()

View File

@ -29,8 +29,10 @@ class BeforehandOrder extends BaseModel
3 => '一条龙订单', 3 => '一条龙订单',
4 => '线上订单', 4 => '线上订单',
5 => '仓库补货', 5 => '仓库补货',
6 => '采购订单', 6 => '往期补单',
7 => '其他订单', 7 => '采购订单',
8 => '其他订单',
9 => '往期补单',
]; ];
return $typeMap[$type] ?? ''; return $typeMap[$type] ?? '';
} }