新增采购产品报价列表的店铺名称搜索功能
- 在搜索条件中增加店铺名称(store_name) - 实现根据店铺名称搜索相关产品,并返回对应报价信息 - 添加店铺名称搜索逻辑,优化搜索结果准确性 - 修复可能存在的搜索空结果问题
This commit is contained in:
parent
bb0bc0c29a
commit
b37080e873
@ -21,6 +21,7 @@ use app\common\model\supplier\Supplier;
|
||||
class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
|
||||
{
|
||||
|
||||
public $is_ids;
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
@ -47,6 +48,15 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$store_name=$this->request->get('store_name');
|
||||
if($store_name){
|
||||
$ids=StoreProduct::where('store_name','like','%'.$store_name.'%')->column('id');
|
||||
if($ids){
|
||||
$this->searchWhere[]=['product_id','in',$ids];
|
||||
}else{
|
||||
$this->is_ids=1;
|
||||
}
|
||||
}
|
||||
return PurchaseProductOffer::where($this->searchWhere)
|
||||
->field(['id', 'supplier_id', 'order_id', 'product_id', 'price','total_price', 'buyer_nums', 'unit', 'is_buyer', 'buyer_confirm', 'is_storage', 'is_stream', 'need_num', 'mark', 'buyer_id', 'status', 'stream_admin_id', 'stream_time', 'storage_admin_id'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
@ -84,6 +94,7 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc
|
||||
}else{
|
||||
$item->is_storage_name='未入库';
|
||||
}
|
||||
$item->pay_type_name=$item->pay_type==1?'赊账':'现金';
|
||||
|
||||
})
|
||||
->toArray();
|
||||
@ -98,6 +109,9 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
if($this->is_ids==1){
|
||||
return 0;
|
||||
}
|
||||
return PurchaseProductOffer::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user