This commit is contained in:
weiz 2024-03-19 14:17:55 +08:00
parent 17d94a5ecd
commit 1261d49889
7 changed files with 6 additions and 80 deletions

View File

@ -62,10 +62,6 @@ class CustomerDemandLists extends BaseAdminDataLists implements ListsSearchInter
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');
@ -97,10 +93,6 @@ class CustomerDemandLists extends BaseAdminDataLists implements ListsSearchInter
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');

View File

@ -42,7 +42,7 @@ class CustomerDemandSolutionLists extends BaseAdminDataLists implements ListsSea
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['project_id','customer_demand_id'], '=' => ['project_id'],
'%like%' => ['theme'], '%like%' => ['theme'],
]; ];
} }
@ -61,10 +61,6 @@ class CustomerDemandSolutionLists extends BaseAdminDataLists implements ListsSea
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');
@ -101,10 +97,6 @@ class CustomerDemandSolutionLists extends BaseAdminDataLists implements ListsSea
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');

View File

@ -61,10 +61,6 @@ class CompetitorLists extends BaseAdminDataLists implements ListsSearchInterface
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');
@ -101,10 +97,6 @@ class CompetitorLists extends BaseAdminDataLists implements ListsSearchInterface
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');

View File

@ -63,10 +63,6 @@ class ProjectEstimateLists extends BaseAdminDataLists implements ListsSearchInte
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');
@ -124,10 +120,6 @@ class ProjectEstimateLists extends BaseAdminDataLists implements ListsSearchInte
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');

View File

@ -61,10 +61,6 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');
@ -99,10 +95,6 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte
{ {
$params = $this->request->param(); $params = $this->request->param();
$where = []; $where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id'); $projectIds = Project::where('custom_id','in',$customIds)->column('id');

View File

@ -60,13 +60,7 @@ class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface,Li
*/ */
public function lists(): array public function lists(): array
{ {
$params = $this->request->param(); return Project::where($this->searchWhere)
$condition = [];
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$condition[] = ['custom_id','in',$customIds];
}
return Project::where($this->searchWhere)->where($condition)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select()->each(function($item){ ->select()->each(function($item){
@ -105,13 +99,7 @@ class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface,Li
*/ */
public function count(): int public function count(): int
{ {
$params = $this->request->param(); return Project::where($this->searchWhere)->count();
$condition = [];
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$condition[] = ['custom_id','in',$customIds];
}
return Project::where($this->searchWhere)->where($condition)->count();
} }
public function setFileName(): string public function setFileName(): string

View File

@ -42,7 +42,7 @@ class ProjectPreSalesMembersLists extends BaseAdminDataLists implements ListsSea
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['project_id', 'technician_ids', 'business_people_ids', 'cross_departmental_personnel_ids'], '=' => ['project_id'],
]; ];
} }
@ -58,18 +58,7 @@ class ProjectPreSalesMembersLists extends BaseAdminDataLists implements ListsSea
*/ */
public function lists(): array public function lists(): array
{ {
$params = $this->request->param(); return ProjectPreSalesMembers::where($this->searchWhere)
$where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id');
$where[] = ['project_id','in',$projectIds];
}
return ProjectPreSalesMembers::where($this->searchWhere)->where($where)
->field(['id,project_id,technician_ids,business_people_ids,cross_departmental_personnel_ids,add_user,create_time']) ->field(['id,project_id,technician_ids,business_people_ids,cross_departmental_personnel_ids,add_user,create_time'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
@ -100,18 +89,7 @@ class ProjectPreSalesMembersLists extends BaseAdminDataLists implements ListsSea
*/ */
public function count(): int public function count(): int
{ {
$params = $this->request->param(); return ProjectPreSalesMembers::where($this->searchWhere)->count();
$where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$projectIds];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$projectIds = Project::where('custom_id','in',$customIds)->column('id');
$where[] = ['project_id','in',$projectIds];
}
return ProjectPreSalesMembers::where($this->searchWhere)->where($where)->count();
} }
public function setFileName(): string public function setFileName(): string