|
|
|
1
|
+<?php
|
|
|
|
2
|
+/**
|
|
|
|
3
|
+ * @remark :
|
|
|
|
4
|
+ * @name :MonthReportController.php
|
|
|
|
5
|
+ * @author :lyh
|
|
|
|
6
|
+ * @method :post
|
|
|
|
7
|
+ * @time :2024/2/2 15:01
|
|
|
|
8
|
+ */
|
|
|
|
9
|
+
|
|
|
|
10
|
+namespace App\Http\Controllers\Bside\BCom;
|
|
|
|
11
|
+
|
|
|
|
12
|
+use App\Enums\Common\Code;
|
|
|
|
13
|
+use App\Http\Controllers\Bside\BaseController;
|
|
|
|
14
|
+use App\Models\HomeCount\MonthCount;
|
|
|
|
15
|
+
|
|
|
|
16
|
+class MonthReportController extends BaseController
|
|
|
|
17
|
+{
|
|
|
|
18
|
+ /**
|
|
|
|
19
|
+ * @remark :获取项目当前所有月份
|
|
|
|
20
|
+ * @name :getMonth
|
|
|
|
21
|
+ * @author :lyh
|
|
|
|
22
|
+ * @method :post
|
|
|
|
23
|
+ * @time :2024/2/2 15:14
|
|
|
|
24
|
+ */
|
|
|
|
25
|
+ public function getMonth(){
|
|
|
|
26
|
+ $monthCountModel = new MonthCount();
|
|
|
|
27
|
+ $this->map['project_id'] = $this->user['project_id'];
|
|
|
|
28
|
+ $month = $monthCountModel->formatQuery($this->map)->pluck('month')->toArray();
|
|
|
|
29
|
+ $this->response('success',Code::SUCCESS,$month);
|
|
|
|
30
|
+ }
|
|
|
|
31
|
+
|
|
|
|
32
|
+ /**
|
|
|
|
33
|
+ * @remark :月报告详情
|
|
|
|
34
|
+ * @name :monthReportInfo
|
|
|
|
35
|
+ * @author :lyh
|
|
|
|
36
|
+ * @method :post
|
|
|
|
37
|
+ * @time :2024/2/2 15:02
|
|
|
|
38
|
+ */
|
|
|
|
39
|
+ public function monthReportInfo(){
|
|
|
|
40
|
+ $monthCountModel = new MonthCount();
|
|
|
|
41
|
+ $this->map['project_id'] = $this->user['project_id'];
|
|
|
|
42
|
+ $info = $monthCountModel->read($this->map);
|
|
|
|
43
|
+ foreach ($info as $k => $v){
|
|
|
|
44
|
+ if(!empty($v['source_country'])){
|
|
|
|
45
|
+ $v['source_country'] = json_decode($v['source_country']);
|
|
|
|
46
|
+ }
|
|
|
|
47
|
+ if(!empty($v['referrer_port'])){
|
|
|
|
48
|
+ $v['referrer_port'] = json_decode($v['referrer_port']);
|
|
|
|
49
|
+ }
|
|
|
|
50
|
+ if(!empty($v['referrer_url'])){
|
|
|
|
51
|
+ $v['referrer_url'] = json_decode($v['referrer_url']);
|
|
|
|
52
|
+ }
|
|
|
|
53
|
+ if(!empty($v['source'])){
|
|
|
|
54
|
+ $v['source'] = json_decode($v['source']);
|
|
|
|
55
|
+ }
|
|
|
|
56
|
+ if(!empty($v['country'])){
|
|
|
|
57
|
+ $v['country'] = json_decode($v['country']);
|
|
|
|
58
|
+ }
|
|
|
|
59
|
+ $lists[$k] = $v;
|
|
|
|
60
|
+ }
|
|
|
|
61
|
+ $this->response('success',Code::SUCCESS,$info);
|
|
|
|
62
|
+ }
|
|
|
|
63
|
+} |