正在显示
1 个修改的文件
包含
10 行增加
和
1 行删除
| @@ -129,7 +129,7 @@ class InquiryMonthlyCount extends Command | @@ -129,7 +129,7 @@ class InquiryMonthlyCount extends Command | ||
| 129 | ->where('updated_date','>=',$startTime->toDateString()) | 129 | ->where('updated_date','>=',$startTime->toDateString()) |
| 130 | ->where('updated_date','<=',$endTime->toDateString()) | 130 | ->where('updated_date','<=',$endTime->toDateString()) |
| 131 | ->orderByDesc('count')->limit(10)->get()->toArray(); | 131 | ->orderByDesc('count')->limit(10)->get()->toArray(); |
| 132 | - if(!empty($data)){ | 132 | + if(!empty($arr['source'])){ |
| 133 | $arr['source'] = json_encode($arr['source']); | 133 | $arr['source'] = json_encode($arr['source']); |
| 134 | } | 134 | } |
| 135 | //访问国家前15 | 135 | //访问国家前15 |
| @@ -139,6 +139,9 @@ class InquiryMonthlyCount extends Command | @@ -139,6 +139,9 @@ class InquiryMonthlyCount extends Command | ||
| 139 | ->where('updated_date','>=',$startTime->toDateString()) | 139 | ->where('updated_date','>=',$startTime->toDateString()) |
| 140 | ->where('updated_date','<=',$endTime->toDateString()) | 140 | ->where('updated_date','<=',$endTime->toDateString()) |
| 141 | ->orderBy('ip','desc')->limit(15)->get()->toArray(); | 141 | ->orderBy('ip','desc')->limit(15)->get()->toArray(); |
| 142 | + if(!empty($arr['source_country'])){ | ||
| 143 | + $arr['source_country'] = json_encode($arr['source_country']); | ||
| 144 | + } | ||
| 142 | //受访界面前15 | 145 | //受访界面前15 |
| 143 | $arr['referrer_url'] = DB::table('gl_customer_visit_item') | 146 | $arr['referrer_url'] = DB::table('gl_customer_visit_item') |
| 144 | ->select('url',DB::raw('COUNT(*) as num')) | 147 | ->select('url',DB::raw('COUNT(*) as num')) |
| @@ -147,6 +150,9 @@ class InquiryMonthlyCount extends Command | @@ -147,6 +150,9 @@ class InquiryMonthlyCount extends Command | ||
| 147 | ->where('updated_date','<=',$endTime->toDateString()) | 150 | ->where('updated_date','<=',$endTime->toDateString()) |
| 148 | ->groupBy('url') | 151 | ->groupBy('url') |
| 149 | ->limit(15)->get()->toArray(); | 152 | ->limit(15)->get()->toArray(); |
| 153 | + if(!empty($arr['referrer_url'])){ | ||
| 154 | + $arr['referrer_url'] = json_encode($arr['referrer_url']); | ||
| 155 | + } | ||
| 150 | //访问断后 | 156 | //访问断后 |
| 151 | $arr['referrer_port'] = DB::table('gl_customer_visit_item') | 157 | $arr['referrer_port'] = DB::table('gl_customer_visit_item') |
| 152 | ->select('device_port',DB::raw('COUNT(*) as num')) | 158 | ->select('device_port',DB::raw('COUNT(*) as num')) |
| @@ -155,6 +161,9 @@ class InquiryMonthlyCount extends Command | @@ -155,6 +161,9 @@ class InquiryMonthlyCount extends Command | ||
| 155 | ->where('updated_date','<=',$endTime->toDateString()) | 161 | ->where('updated_date','<=',$endTime->toDateString()) |
| 156 | ->groupBy('device_port') | 162 | ->groupBy('device_port') |
| 157 | ->limit(15)->get()->toArray(); | 163 | ->limit(15)->get()->toArray(); |
| 164 | + if(!empty($arr['referrer_port'])){ | ||
| 165 | + $arr['referrer_port'] = json_encode($arr['referrer_port']); | ||
| 166 | + } | ||
| 158 | return $arr; | 167 | return $arr; |
| 159 | } | 168 | } |
| 160 | } | 169 | } |
-
请 注册 或 登录 后发表评论