This commit is contained in:
weiz 2024-03-19 17:12:54 +08:00
parent 81c0059f63
commit 1aa47576c5

View File

@ -57,14 +57,8 @@ class QuotationLists extends BaseAdminDataLists implements ListsSearchInterface,
*/
public function lists(): array
{
$params = $this->request->get(['custom_name']);
$where = [];
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$where[] = ['custom_id','in',$custom_ids];
}
return Quotation::field('id,custom_id,code,quotation_date,create_user,invoice_type,freight,other_fee,customer_require,remark')
->where($this->searchWhere)->where($where)->limit($this->limitOffset, $this->limitLength)
->where($this->searchWhere)->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()->each(function($item){
$custom = Custom::field('name,master_name,master_phone')->where('id',$item['custom_id'])->findOrEmpty();
@ -88,13 +82,7 @@ class QuotationLists extends BaseAdminDataLists implements ListsSearchInterface,
*/
public function count(): int
{
$params = $this->request->get(['custom_name']);
$where = [];
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$where[] = ['custom_id','in',$custom_ids];
}
return Quotation::where($this->searchWhere)->where($where)->count();
return Quotation::where($this->searchWhere)->count();
}
public function setFileName(): string