feat(system_store_storage): 添加根据状态查询入库记录功能
This commit is contained in:
parent
f2a136b5dd
commit
a8e0cd003a
@ -28,6 +28,7 @@ class SystemStoreStorageController extends BaseAdminController
|
|||||||
// ]
|
// ]
|
||||||
public function lists()
|
public function lists()
|
||||||
{
|
{
|
||||||
|
$this->request->__set('status',-1);
|
||||||
return $this->dataLists(new SystemStoreStorageLists());
|
return $this->dataLists(new SystemStoreStorageLists());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,10 +46,13 @@ class SystemStoreStorageLists extends BaseAdminDataLists implements ListsSearchI
|
|||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
$this->searchWhere[] = ['store_id','=',$this->adminInfo['store_id']];//只显示当前门店的入库记录
|
$this->searchWhere[] = ['store_id','=',$this->adminInfo['store_id']];//只显示当前门店的入库记录
|
||||||
|
if($this->request->__get('status')==-1){
|
||||||
|
$this->searchWhere[] = ['status','>',0];
|
||||||
|
}
|
||||||
return SystemStoreStorage::where($this->searchWhere)
|
return SystemStoreStorage::where($this->searchWhere)
|
||||||
->field(['id', 'store_id', 'admin_id', 'staff_id', 'product_id', 'nums','mark', 'status'])
|
->field(['id', 'store_id', 'admin_id', 'staff_id', 'product_id', 'nums','mark', 'status'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['status' => 'aes'])
|
||||||
->select()->each(function ($item) {
|
->select()->each(function ($item) {
|
||||||
$item['system_store_name'] = SystemStore::where('id', $item['store_id'])->value('name');
|
$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');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user