feat: 添加门店入库记录列表查询功能

This commit is contained in:
mkm 2024-06-07 14:30:17 +08:00
parent 263882c4be
commit c3202c68f6

View File

@ -6,7 +6,10 @@ namespace app\admin\lists\system_store_storage;
use app\admin\lists\BaseAdminDataLists; use app\admin\lists\BaseAdminDataLists;
use app\common\model\system_store_storage\SystemStoreStorage; use app\common\model\system_store_storage\SystemStoreStorage;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\auth\Admin;
use app\common\model\store_product\StoreProduct;
use app\common\model\system_store\SystemStore;
use app\common\model\system_store\SystemStoreStaff;
/** /**
* 门店入库记录列表 * 门店入库记录列表
@ -46,7 +49,18 @@ class SystemStoreStorageLists extends BaseAdminDataLists implements ListsSearchI
->field(['id', 'store_id', 'admin_id', 'staff_id', 'product_id', 'nums', 'status']) ->field(['id', 'store_id', 'admin_id', 'staff_id', 'product_id', 'nums', 'status'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()->each(function($item){
$item['system_store_name']=SystemStore::where('id',$item['store_id'])->value('name');
$item['admin_name']=Admin::where('id',$item['admin_id'])->value('name');
$item['admin_name']=Admin::where('id',$item['admin_id'])->value('name');
if($item['staff_id']>0){
$item['staff_name']=SystemStoreStaff::where('id',$item['staff_id'])->value('staff_name');
}else{
$item['staff_name']='无';
}
$item['store_name']=StoreProduct::where('id',$item['product_id'])->value('store_name');
return $item;
})
->toArray(); ->toArray();
} }