This commit is contained in:
chenbo 2024-02-29 16:43:38 +08:00
parent b16bb6cf33
commit c8249989dc

View File

@ -23,24 +23,24 @@ class CostConsultationReportController extends BaseAdminController
$part_a = $params['part_a'] ?? '';
$query = Db::name('cost_approved_project')->where(function ($query) use ($contract_name, $contract_num, $part_a) {
if ($contract_name) {
$query->where('c.contract_name', 'like', '%'.$contract_name.'%');
$query->where('contract_name', 'like', '%'.$contract_name.'%');
}
if ($contract_num) {
$query->where('c.contract_num', '=', $contract_num);
$query->where('contract_num', '=', $contract_num);
}
if ($part_a) {
$query->where('c.part_a', 'like', '%'.$part_a.'%');
$query->where('part_a', 'like', '%'.$part_a.'%');
}
});
$count = $query->count();
$list = $query->page($page_no, $page_size)->select()->each(function($item){
$lists = $query->page($page_no, $page_size)->select()->each(function($item){
$item['start_date'] = date('Y-m-d', $item['start_date']);
$item['end_date'] = date('Y-m-d', $item['end_date']);
$item['due_time'] = date('Y-m-d', $item['due_time']);
$item['create_date'] = date('Y-m-d', $item['create_date']);
return $item;
});
return $this->success('成功', compact('count', 'list', 'page_no', 'page_size'));
return $this->success('成功', compact('count', 'lists', 'page_no', 'page_size'));
}
// 造价项目信息汇总
@ -69,8 +69,8 @@ class CostConsultationReportController extends BaseAdminController
}
});
$count = $query->count();
$list = $query->page($page_no, $page_size)->select();
return $this->success('成功', compact('count', 'list', 'page_no', 'page_size'));
$lists = $query->page($page_no, $page_size)->select();
return $this->success('成功', compact('count', 'lists', 'page_no', 'page_size'));
}
// 项目全过程跟踪表
@ -104,7 +104,7 @@ class CostConsultationReportController extends BaseAdminController
return $count > 0 ? 1: 0;
});
$count = $query->count();
$list = $query->page($page_no, $page_size)->select();
return $this->success('成功', compact('count', 'list', 'page_no', 'page_size'));
$lists = $query->page($page_no, $page_size)->select();
return $this->success('成功', compact('count', 'lists', 'page_no', 'page_size'));
}
}