update
This commit is contained in:
parent
fb2f0d86ab
commit
4cdeab385d
@ -58,7 +58,13 @@ class CustomContactsLists extends BaseAdminDataLists implements ListsSearchInter
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return CustomContacts::field('id,custom_id,name,position,phone,telephone,email,notes,annex')->where($this->searchWhere)
|
$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 CustomContacts::field('id,custom_id,name,position,phone,telephone,email,notes,annex')->where($this->searchWhere)->where($where)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function($item){
|
->select()->each(function($item){
|
||||||
@ -82,7 +88,13 @@ class CustomContactsLists extends BaseAdminDataLists implements ListsSearchInter
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
return CustomContacts::where($this->searchWhere)->count();
|
$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 CustomContacts::where($this->searchWhere)->where($where)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user