no commit message
This commit is contained in:
@@ -2848,6 +2848,55 @@ EOF;
|
||||
return $page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报告制作数量统计
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function getReportProduceCount() {
|
||||
$pendingCount = Db::name('report')
|
||||
->alias('r')
|
||||
->join('inquiry i', 'r.quot_id = i.id', 'LEFT')
|
||||
->where('r.report_source', 1)
|
||||
->where('r.status', 1)
|
||||
->where('r.create_time', 'gt', '2025-02-01 00:00:00');
|
||||
$pending = $pendingCount->count();
|
||||
|
||||
// 二审待制作:以 pg_report 为主表,review_status=1 且 status=2,关联 pg_inquiry
|
||||
$secondReviewCount = Db::name('report')
|
||||
->alias('r')
|
||||
->join('inquiry i', 'r.quot_id = i.id', 'LEFT')
|
||||
->where('r.report_source', 1)
|
||||
->where('r.review_status', 1)
|
||||
->where('r.status', 2)
|
||||
->where('r.create_time', 'gt', '2025-02-01 00:00:00')
|
||||
->where('i.status', 7)
|
||||
->group('r.quot_id');
|
||||
|
||||
$secondReview = $secondReviewCount->count();
|
||||
|
||||
// 三审待制作:以 pg_report 为主表,review_status=2 且 review2_status=1 且 status=2,关联 pg_inquiry
|
||||
$thirdReviewCount = Db::name('report')
|
||||
->alias('r')
|
||||
->join('inquiry i', 'r.quot_id = i.id', 'LEFT')
|
||||
->where('r.report_source', 1)
|
||||
->where('r.review_status', 2)
|
||||
->where('r.review2_status', 1)
|
||||
->where('r.create_time', 'gt', '2025-02-01 00:00:00')
|
||||
->where('r.status', 2);
|
||||
|
||||
$thirdReview = $thirdReviewCount->count();
|
||||
|
||||
// 计算总数
|
||||
$total = $pending + $secondReview + $thirdReview;
|
||||
|
||||
return $this->buildSuccess([
|
||||
'pending' => $pending,
|
||||
'secondReview' => $secondReview,
|
||||
'thirdReview' => $thirdReview,
|
||||
'total' => $total
|
||||
]);
|
||||
}
|
||||
|
||||
public function cancelAntiCounterfeitCode()
|
||||
{
|
||||
$reportid = $this->request->post("reportid");
|
||||
|
||||
Reference in New Issue
Block a user