作者 lyh

gx

<?php
/**
* @remark :
* @name :MonthReportController.php
* @author :lyh
* @method :post
* @time :2024/2/2 15:01
*/
namespace App\Http\Controllers\Bside\BCom;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\HomeCount\MonthCount;
class MonthReportController extends BaseController
{
/**
* @remark :获取项目当前所有月份
* @name :getMonth
* @author :lyh
* @method :post
* @time :2024/2/2 15:14
*/
public function getMonth(){
$monthCountModel = new MonthCount();
$this->map['project_id'] = $this->user['project_id'];
$month = $monthCountModel->formatQuery($this->map)->pluck('month')->toArray();
$this->response('success',Code::SUCCESS,$month);
}
/**
* @remark :月报告详情
* @name :monthReportInfo
* @author :lyh
* @method :post
* @time :2024/2/2 15:02
*/
public function monthReportInfo(){
$monthCountModel = new MonthCount();
$this->map['project_id'] = $this->user['project_id'];
$info = $monthCountModel->read($this->map);
foreach ($info as $k => $v){
if(!empty($v['source_country'])){
$v['source_country'] = json_decode($v['source_country']);
}
if(!empty($v['referrer_port'])){
$v['referrer_port'] = json_decode($v['referrer_port']);
}
if(!empty($v['referrer_url'])){
$v['referrer_url'] = json_decode($v['referrer_url']);
}
if(!empty($v['source'])){
$v['source'] = json_decode($v['source']);
}
if(!empty($v['country'])){
$v['country'] = json_decode($v['country']);
}
$lists[$k] = $v;
}
$this->response('success',Code::SUCCESS,$info);
}
}
... ...
... ... @@ -495,6 +495,12 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/save', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'save'])->name('rating_save');
Route::any('/code', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'verificationCode'])->name('rating_code');
});
//月报表
Route::prefix('month_report')->group(function () {
Route::any('/month', [\App\Http\Controllers\Bside\BCom\MonthReportController::class, 'getMonth'])->name('month_report_getMonth');
Route::any('/read', [\App\Http\Controllers\Bside\BCom\MonthReportController::class, 'monthReportInfo'])->name('month_report_read');
});
});
//无需登录验证的路由组
Route::group([], function () {
... ...