|
|
|
<?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);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|