This commit is contained in:
weiz 2024-01-13 15:26:48 +08:00
parent 1c0ccbdf48
commit cba6ceb109
6 changed files with 37 additions and 9 deletions

View File

@ -44,7 +44,8 @@ class BuildPlanLists extends BaseAdminDataLists implements ListsSearchInterface
public function setSearch(): array
{
return [
'=' => ['zy_code', 'plan_start_date', 'plan_end_date', 'work_user'],
'=' => ['project_id', 'plan_start_date', 'plan_end_date'],
'%like%' => ['zy_code','work_user']
];
}

View File

@ -58,7 +58,14 @@ class BuildReportDetailLists extends BaseAdminDataLists implements ListsSearchIn
*/
public function lists(): array
{
return BuildReportDetail::where($this->searchWhere)
$params = $this->request->get(['project_id']);
$where = [];
if(isset($params['project_id']) && $params['project_id'] != 0){
$plan_ids = BuildPlan::where('project_id',$params['project_id'])->column('id');
$report_ids = BuildReport::where('plan_id','in',$plan_ids)->column('id');
$where[] = ['report_id','in',$report_ids];
}
return BuildReportDetail::where($this->searchWhere)->where($where)
->field(['id', 'report_id', 'person_id', 'work_num', 'remark'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
@ -92,7 +99,14 @@ class BuildReportDetailLists extends BaseAdminDataLists implements ListsSearchIn
*/
public function count(): int
{
return BuildReportDetail::where($this->searchWhere)->count();
$params = $this->request->get(['project_id']);
$where = [];
if(isset($params['project_id']) && $params['project_id'] != 0){
$plan_ids = BuildPlan::where('project_id',$params['project_id'])->column('id');
$report_ids = BuildReport::where('plan_id','in',$plan_ids)->column('id');
$where[] = ['report_id','in',$report_ids];
}
return BuildReportDetail::where($this->searchWhere)->where($where)->count();
}
}

View File

@ -44,9 +44,7 @@ class BuildReportLists extends BaseAdminDataLists implements ListsSearchInterfac
*/
public function setSearch(): array
{
return [
];
return [];
}
@ -61,7 +59,13 @@ class BuildReportLists extends BaseAdminDataLists implements ListsSearchInterfac
*/
public function lists(): array
{
return BuildReport::where($this->searchWhere)
$params = $this->request->get(['project_id']);
$where = [];
if(isset($params['project_id']) && $params['project_id'] != 0){
$plan_ids = BuildPlan::where('project_id',$params['project_id'])->column('id');
$where[] = ['plan_id','in',$plan_ids];
}
return BuildReport::where($this->searchWhere)->where($where)
->field(['id', 'report_code', 'plan_id', 'scene_file', 'report_workload', 'report_amount', 'remark', 'add_user'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
@ -103,7 +107,13 @@ class BuildReportLists extends BaseAdminDataLists implements ListsSearchInterfac
*/
public function count(): int
{
return BuildReport::where($this->searchWhere)->count();
$params = $this->request->get(['project_id']);
$where = [];
if(isset($params['project_id']) && $params['project_id'] != 0){
$plan_ids = BuildPlan::where('project_id',$params['project_id'])->column('id');
$where[] = ['plan_id','in',$plan_ids];
}
return BuildReport::where($this->searchWhere)->where($where)->count();
}
}

View File

@ -40,6 +40,7 @@ class ProjectDocumentLists extends BaseAdminDataLists implements ListsSearchInte
public function setSearch(): array
{
return [
'=' => ['project_id'],
'%like%' => ['code', 'name'],
];
}

View File

@ -41,6 +41,7 @@ class ProjectSettlementLists extends BaseAdminDataLists implements ListsSearchIn
public function setSearch(): array
{
return [
'=' => ['project_id'],
'%like%' => ['settlement_code'],
];
}

View File

@ -43,7 +43,8 @@ class ProjectSubcontractSettlementLists extends BaseAdminDataLists implements Li
public function setSearch(): array
{
return [
'=' => ['settlement_code'],
'=' => ['project_id'],
'%like%' => ['settlement_code'],
];
}