feat: 修改商品列表API,增加'total_price'字段,修复'is_lack'判断逻辑
This commit is contained in:
parent
64396fe1b5
commit
21baf23272
@ -68,24 +68,16 @@ class BranchProductLists extends BaseApiDataLists implements ListsSearchInterfac
|
||||
// } else {
|
||||
// $order = [$field => $order];
|
||||
// }
|
||||
$fields = 'id,top_cate_id,cate_id,store_name,cost,vip_price,purchase,price,bar_code,image,sales,store_info,unit,batch,two_cate_id,stock,is_lack';
|
||||
|
||||
$tag = '';
|
||||
|
||||
$this->searchWhere[] = ['is_show', '=', 1];
|
||||
$fields = 'id,top_cate_id,cate_id,store_name,cost,vip_price,purchase,price,bar_code,image,sales,store_info,unit,batch,two_cate_id,stock,total_price';
|
||||
|
||||
$this->searchWhere[] = ['status', '=', 1];
|
||||
$this->searchWhere[] = ['product_type', 'in', [0,4]];
|
||||
return StoreBranchProduct::where($this->searchWhere)
|
||||
->field($fields)
|
||||
->with(['className', 'unitName'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order($this->sortOrder)
|
||||
->select()->each(function ($item) use ($tag) {
|
||||
if($item['is_lack']==1){
|
||||
$tag='缺货';
|
||||
}
|
||||
$item['tag'] = $tag;
|
||||
return $item;
|
||||
})
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user