update
This commit is contained in:
parent
fbc4b19d7a
commit
25cb0a0c43
@ -58,13 +58,17 @@ class BuildReportDetailLists extends BaseAdminDataLists implements ListsSearchIn
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
$params = $this->request->get(['project_id']);
|
$params = $this->request->get(['project_id','plan_id']);
|
||||||
$where = [];
|
$where = [];
|
||||||
if(isset($params['project_id']) && $params['project_id'] != 0){
|
if(isset($params['project_id']) && $params['project_id'] != 0){
|
||||||
$plan_ids = BuildPlan::where('project_id',$params['project_id'])->column('id');
|
$plan_ids = BuildPlan::where('project_id',$params['project_id'])->column('id');
|
||||||
$report_ids = BuildReport::where('plan_id','in',$plan_ids)->column('id');
|
$report_ids = BuildReport::where('plan_id','in',$plan_ids)->column('id');
|
||||||
$where[] = ['report_id','in',$report_ids];
|
$where[] = ['report_id','in',$report_ids];
|
||||||
}
|
}
|
||||||
|
if(isset($params['plan_id']) && $params['plan_id'] != 0){
|
||||||
|
$report_ids = BuildReport::where('plan_id',$params['plan_id'])->column('id');
|
||||||
|
$where[] = ['report_id','in',$report_ids];
|
||||||
|
}
|
||||||
return BuildReportDetail::where($this->searchWhere)->where($where)
|
return BuildReportDetail::where($this->searchWhere)->where($where)
|
||||||
->field(['id', 'report_id', 'person_id', 'work_num', 'remark'])
|
->field(['id', 'report_id', 'person_id', 'work_num', 'remark'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
@ -99,13 +103,17 @@ class BuildReportDetailLists extends BaseAdminDataLists implements ListsSearchIn
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
$params = $this->request->get(['project_id']);
|
$params = $this->request->get(['project_id','plan_id']);
|
||||||
$where = [];
|
$where = [];
|
||||||
if(isset($params['project_id']) && $params['project_id'] != 0){
|
if(isset($params['project_id']) && $params['project_id'] != 0){
|
||||||
$plan_ids = BuildPlan::where('project_id',$params['project_id'])->column('id');
|
$plan_ids = BuildPlan::where('project_id',$params['project_id'])->column('id');
|
||||||
$report_ids = BuildReport::where('plan_id','in',$plan_ids)->column('id');
|
$report_ids = BuildReport::where('plan_id','in',$plan_ids)->column('id');
|
||||||
$where[] = ['report_id','in',$report_ids];
|
$where[] = ['report_id','in',$report_ids];
|
||||||
}
|
}
|
||||||
|
if(isset($params['plan_id']) && $params['plan_id'] != 0){
|
||||||
|
$report_ids = BuildReport::where('plan_id',$params['plan_id'])->column('id');
|
||||||
|
$where[] = ['report_id','in',$report_ids];
|
||||||
|
}
|
||||||
return BuildReportDetail::where($this->searchWhere)->where($where)->count();
|
return BuildReportDetail::where($this->searchWhere)->where($where)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,9 @@ class BuildReportLists extends BaseAdminDataLists implements ListsSearchInterfac
|
|||||||
*/
|
*/
|
||||||
public function setSearch(): array
|
public function setSearch(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [
|
||||||
|
'=' => ['plan_id']
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user