修改商品列表查询
This commit is contained in:
parent
baeb03fd84
commit
444b011d0f
@ -9,8 +9,10 @@ use app\common\model\store_product\StoreProduct;
|
|||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\lists\ListsSearchInterface;
|
||||||
use app\common\model\store_branch_product\StoreBranchProduct;
|
use app\common\model\store_branch_product\StoreBranchProduct;
|
||||||
use app\common\model\store_category\StoreCategory;
|
use app\common\model\store_category\StoreCategory;
|
||||||
|
use app\common\model\store_product_group_price\StoreProductGroupPrice;
|
||||||
use app\common\model\store_product_unit\StoreProductUnit;
|
use app\common\model\store_product_unit\StoreProductUnit;
|
||||||
use app\common\model\system_store\SystemStore;
|
use app\common\model\system_store\SystemStore;
|
||||||
|
use app\common\model\user\User;
|
||||||
use app\common\model\warehouse_product_storege\WarehouseProductStorege;
|
use app\common\model\warehouse_product_storege\WarehouseProductStorege;
|
||||||
use app\common\lists\ListsExcelInterface;
|
use app\common\lists\ListsExcelInterface;
|
||||||
|
|
||||||
@ -62,10 +64,11 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$is_warehouse=$this->request->get('is_warehouse',0);
|
$is_warehouse=$this->request->get('is_warehouse',0);
|
||||||
return StoreProduct::where($this->searchWhere)
|
$list = StoreProduct::where($this->searchWhere)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function ($item) use($is_warehouse) {
|
->select()->each(function ($item) use($is_warehouse) {
|
||||||
|
$item['product_id'] = $item['id'];
|
||||||
$item['bar_code_two'] = '';
|
$item['bar_code_two'] = '';
|
||||||
if (in_array($item['unit'], [2, 21])) {
|
if (in_array($item['unit'], [2, 21])) {
|
||||||
$item['bar_code_two'] = $item['bar_code'];
|
$item['bar_code_two'] = $item['bar_code'];
|
||||||
@ -110,6 +113,11 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|||||||
}
|
}
|
||||||
return $item;
|
return $item;
|
||||||
})?->toArray();
|
})?->toArray();
|
||||||
|
if (!empty($this->params['user_id'])) {
|
||||||
|
$userShip = User::where('id', $this->params['user_id'])->value('user_ship');
|
||||||
|
$list = StoreProductGroupPrice::resetProductsPrice($list, $userShip);
|
||||||
|
}
|
||||||
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,8 +52,9 @@ class StoreProductPriceLists extends BaseAdminDataLists implements ListsSearchIn
|
|||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function($item){
|
->select()->each(function($item){
|
||||||
$find = StoreProduct::where('id', $item['product_id'])->field('image,store_name')->find();
|
$find = StoreProduct::where('id', $item['product_id'])->field('image,store_name,store_info')->find();
|
||||||
$item['store_name']=$find['store_name'];
|
$item['store_name']=$find['store_name'];
|
||||||
|
$item['store_info']=$find['store_info'];
|
||||||
$item['image']=$find['image'];
|
$item['image']=$find['image'];
|
||||||
$item['status_name']=$item['status']==0?"未设置":"已设置";
|
$item['status_name']=$item['status']==0?"未设置":"已设置";
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user