|
...
|
...
|
@@ -532,7 +532,7 @@ class InquiryForwardLogic extends BaseLogic |
|
|
|
|
|
|
|
//月统计
|
|
|
|
$last_year_month = date('Y-m', strtotime('-11 months'));
|
|
|
|
$manage_ids = ForwardCount::select('manage_id')->where('created_at', '>', $last_year_month . '-02')->where('count', '>', 0)->orderBy('manage_id', 'asc')->distinct()->pluck('manage_id')->toArray();
|
|
|
|
$month_manage_ids = ForwardCount::select('manage_id')->where('created_at', '>', $last_year_month . '-02')->where('count', '>', 0)->orderBy('manage_id', 'asc')->distinct()->pluck('manage_id')->toArray();
|
|
|
|
|
|
|
|
$data_month = [];
|
|
|
|
$data_month_total = [];
|
|
...
|
...
|
@@ -542,9 +542,9 @@ class InquiryForwardLogic extends BaseLogic |
|
|
|
$year = $month_arr[0];
|
|
|
|
$month = $month_arr[1];
|
|
|
|
|
|
|
|
foreach ($manage_ids as $mid) {
|
|
|
|
$name = $manageModel->getName($mid);
|
|
|
|
$month_count = intval(ForwardCount::where('manage_id', $mid)->where('year', $year)->where('month', $month)->sum('count') ?? 0);
|
|
|
|
foreach ($month_manage_ids as $month_mid) {
|
|
|
|
$name = $manageModel->getName($month_mid);
|
|
|
|
$month_count = intval(ForwardCount::where('manage_id', $month_mid)->where('year', $year)->where('month', $month)->sum('count') ?? 0);
|
|
|
|
$data_month_total[$name] = ($data_month_total[$name] ?? 0) + $month_count;
|
|
|
|
$data_month[$last_year_month][$name] = $month_count;
|
|
|
|
}
|
|
...
|
...
|
@@ -556,7 +556,7 @@ class InquiryForwardLogic extends BaseLogic |
|
|
|
|
|
|
|
//周统计
|
|
|
|
$last_week_day = date('Y-m-d', strtotime('-1 week'));
|
|
|
|
$manage_ids = ForwardCount::select('manage_id')->where('created_at', '>', $last_week_day . ' +1 day')->where('count', '>', 0)->orderBy('manage_id', 'asc')->distinct()->pluck('manage_id')->toArray();
|
|
|
|
$week_manage_ids = ForwardCount::select('manage_id')->where('created_at', '>', $last_week_day . ' +1 day')->where('count', '>', 0)->orderBy('manage_id', 'asc')->distinct()->pluck('manage_id')->toArray();
|
|
|
|
|
|
|
|
$data_week = [];
|
|
|
|
$data_week_total = [];
|
|
...
|
...
|
@@ -567,9 +567,9 @@ class InquiryForwardLogic extends BaseLogic |
|
|
|
$month = $day_arr[1];
|
|
|
|
$day = $day_arr[2];
|
|
|
|
|
|
|
|
foreach ($manage_ids as $mid) {
|
|
|
|
$name = $manageModel->getName($mid);
|
|
|
|
$day_count = ForwardCount::where('manage_id', $mid)->where('year', $year)->where('month', $month)->where('day', $day)->value('count') ?? 0;
|
|
|
|
foreach ($week_manage_ids as $week_mid) {
|
|
|
|
$name = $manageModel->getName($week_mid);
|
|
|
|
$day_count = ForwardCount::where('manage_id', $week_mid)->where('year', $year)->where('month', $month)->where('day', $day)->value('count') ?? 0;
|
|
|
|
$data_week_total[$name] = ($data_week_total[$name] ?? 0) + $day_count;
|
|
|
|
$data_week[substr($last_week_day, 5)][$name] = $day_count;
|
|
|
|
}
|
...
|
...
|
|