Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
4 个修改的文件
包含
10 行增加
和
18 行删除
| @@ -80,7 +80,7 @@ class Count extends Command | @@ -80,7 +80,7 @@ class Count extends Command | ||
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | /** | 82 | /** |
| 83 | - * @name :(统计pv)pv_num | 83 | + * @name :(统计ip)ip_num |
| 84 | * @author :lyh | 84 | * @author :lyh |
| 85 | * @method :post | 85 | * @method :post |
| 86 | * @time :2023/6/14 15:40 | 86 | * @time :2023/6/14 15:40 |
| @@ -125,24 +125,21 @@ class InquiryMonthlyCount extends Command | @@ -125,24 +125,21 @@ class InquiryMonthlyCount extends Command | ||
| 125 | $source = DB::table('gl_customer_visit') | 125 | $source = DB::table('gl_customer_visit') |
| 126 | ->select('referrer_url', DB::raw('COUNT(*) as count')) | 126 | ->select('referrer_url', DB::raw('COUNT(*) as count')) |
| 127 | ->groupBy('referrer_url')->where(['domain'=>$domain]) | 127 | ->groupBy('referrer_url')->where(['domain'=>$domain]) |
| 128 | - ->where('updated_date','>=',$startTime->toDateString()) | ||
| 129 | - ->where('updated_date','<=',$endTime->toDateString()) | 128 | + ->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()]) |
| 130 | ->orderByDesc('count')->limit(10)->get()->toArray(); | 129 | ->orderByDesc('count')->limit(10)->get()->toArray(); |
| 131 | $arr['source'] = json_encode($source); | 130 | $arr['source'] = json_encode($source); |
| 132 | //访问国家前15 | 131 | //访问国家前15 |
| 133 | $source_country = DB::table('gl_customer_visit') | 132 | $source_country = DB::table('gl_customer_visit') |
| 134 | ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) | 133 | ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) |
| 135 | ->groupBy('country')->where(['domain'=>$domain]) | 134 | ->groupBy('country')->where(['domain'=>$domain]) |
| 136 | - ->where('updated_date','>=',$startTime->toDateString()) | ||
| 137 | - ->where('updated_date','<=',$endTime->toDateString()) | 135 | + ->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()]) |
| 138 | ->orderBy('ip','desc')->limit(15)->get()->toArray(); | 136 | ->orderBy('ip','desc')->limit(15)->get()->toArray(); |
| 139 | $arr['source_country'] = json_encode($source_country); | 137 | $arr['source_country'] = json_encode($source_country); |
| 140 | //受访界面前15 | 138 | //受访界面前15 |
| 141 | $referrer_url = DB::table('gl_customer_visit') | 139 | $referrer_url = DB::table('gl_customer_visit') |
| 142 | ->select('url',DB::raw('COUNT(*) as num')) | 140 | ->select('url',DB::raw('COUNT(*) as num')) |
| 143 | ->orderBy('num','desc')->where(['domain'=>$domain]) | 141 | ->orderBy('num','desc')->where(['domain'=>$domain]) |
| 144 | - ->where('updated_date','>=',$startTime->toDateString()) | ||
| 145 | - ->where('updated_date','<=',$endTime->toDateString()) | 142 | + ->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()]) |
| 146 | ->groupBy('url') | 143 | ->groupBy('url') |
| 147 | ->limit(15)->get()->toArray(); | 144 | ->limit(15)->get()->toArray(); |
| 148 | $arr['referrer_url'] = json_encode($referrer_url); | 145 | $arr['referrer_url'] = json_encode($referrer_url); |
| @@ -150,8 +147,7 @@ class InquiryMonthlyCount extends Command | @@ -150,8 +147,7 @@ class InquiryMonthlyCount extends Command | ||
| 150 | $referrer_port = DB::table('gl_customer_visit') | 147 | $referrer_port = DB::table('gl_customer_visit') |
| 151 | ->select('device_port',DB::raw('COUNT(*) as num')) | 148 | ->select('device_port',DB::raw('COUNT(*) as num')) |
| 152 | ->orderBy('num','desc')->where(['domain'=>$domain]) | 149 | ->orderBy('num','desc')->where(['domain'=>$domain]) |
| 153 | - ->where('updated_date','>=',$startTime->toDateString()) | ||
| 154 | - ->where('updated_date','<=',$endTime->toDateString()) | 150 | + ->whereBetween('updated_date', [$startTime->toDateString(),$endTime->toDateString()]) |
| 155 | ->groupBy('device_port') | 151 | ->groupBy('device_port') |
| 156 | ->limit(15)->get()->toArray(); | 152 | ->limit(15)->get()->toArray(); |
| 157 | $arr['referrer_port'] = json_encode($referrer_port); | 153 | $arr['referrer_port'] = json_encode($referrer_port); |
| @@ -123,24 +123,21 @@ class MonthCountLogic extends BaseLogic | @@ -123,24 +123,21 @@ class MonthCountLogic extends BaseLogic | ||
| 123 | $source = DB::table('gl_customer_visit') | 123 | $source = DB::table('gl_customer_visit') |
| 124 | ->select('referrer_url', DB::raw('COUNT(*) as count')) | 124 | ->select('referrer_url', DB::raw('COUNT(*) as count')) |
| 125 | ->groupBy('referrer_url')->where(['domain'=>$domain]) | 125 | ->groupBy('referrer_url')->where(['domain'=>$domain]) |
| 126 | -// ->where('updated_date','>=',$startTime) | ||
| 127 | -// ->where('updated_date','<=',$endTime) | 126 | +// ->whereBetween('updated_date', [$startTime,$endTime]) |
| 128 | ->orderByDesc('count')->limit(10)->get()->toArray(); | 127 | ->orderByDesc('count')->limit(10)->get()->toArray(); |
| 129 | $arr['source'] = $source; | 128 | $arr['source'] = $source; |
| 130 | //访问国家前15 | 129 | //访问国家前15 |
| 131 | $source_country = DB::table('gl_customer_visit') | 130 | $source_country = DB::table('gl_customer_visit') |
| 132 | ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) | 131 | ->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv')) |
| 133 | ->groupBy('country')->where(['domain'=>$domain]) | 132 | ->groupBy('country')->where(['domain'=>$domain]) |
| 134 | -// ->where('updated_date','>=',$startTime) | ||
| 135 | -// ->where('updated_date','<=',$endTime) | 133 | +// ->whereBetween('updated_date', [$startTime,$endTime]) |
| 136 | ->orderBy('ip','desc')->limit(15)->get()->toArray(); | 134 | ->orderBy('ip','desc')->limit(15)->get()->toArray(); |
| 137 | $arr['source_country'] = $source_country; | 135 | $arr['source_country'] = $source_country; |
| 138 | //受访界面前15 | 136 | //受访界面前15 |
| 139 | $referrer_url = DB::table('gl_customer_visit') | 137 | $referrer_url = DB::table('gl_customer_visit') |
| 140 | ->select('url',DB::raw('COUNT(*) as num')) | 138 | ->select('url',DB::raw('COUNT(*) as num')) |
| 141 | ->orderBy('num','desc')->where(['domain'=>$domain]) | 139 | ->orderBy('num','desc')->where(['domain'=>$domain]) |
| 142 | -// ->where('updated_date','>=',$startTime) | ||
| 143 | -// ->where('updated_date','<=',$endTime) | 140 | +// ->whereBetween('updated_date', [$startTime,$endTime]) |
| 144 | ->groupBy('url') | 141 | ->groupBy('url') |
| 145 | ->limit(15)->get()->toArray(); | 142 | ->limit(15)->get()->toArray(); |
| 146 | $arr['referrer_url'] = $referrer_url; | 143 | $arr['referrer_url'] = $referrer_url; |
| @@ -148,8 +145,7 @@ class MonthCountLogic extends BaseLogic | @@ -148,8 +145,7 @@ class MonthCountLogic extends BaseLogic | ||
| 148 | $referrer_port = DB::table('gl_customer_visit') | 145 | $referrer_port = DB::table('gl_customer_visit') |
| 149 | ->select('device_port',DB::raw('COUNT(*) as num')) | 146 | ->select('device_port',DB::raw('COUNT(*) as num')) |
| 150 | ->orderBy('num','desc')->where(['domain'=>$domain]) | 147 | ->orderBy('num','desc')->where(['domain'=>$domain]) |
| 151 | -// ->where('updated_date','>=',$startTime) | ||
| 152 | -// ->where('updated_date','<=',$endTime) | 148 | +// ->whereBetween('updated_date', [$startTime,$endTime]) |
| 153 | ->groupBy('device_port') | 149 | ->groupBy('device_port') |
| 154 | ->limit(15)->get()->toArray(); | 150 | ->limit(15)->get()->toArray(); |
| 155 | $arr['referrer_port'] = $referrer_port; | 151 | $arr['referrer_port'] = $referrer_port; |
| @@ -185,7 +185,7 @@ class Base extends Model | @@ -185,7 +185,7 @@ class Base extends Model | ||
| 185 | $query->whereIn($k, $v[1]); | 185 | $query->whereIn($k, $v[1]); |
| 186 | break; | 186 | break; |
| 187 | case 'or': | 187 | case 'or': |
| 188 | - // in查询 ['id'=>['in',[1,2,3]]] | 188 | + // in查询 ['id'=>['or',[1,2,3]]] |
| 189 | $query->orWhere($k, $v[1]); | 189 | $query->orWhere($k, $v[1]); |
| 190 | break; | 190 | break; |
| 191 | case 'not in': | 191 | case 'not in': |
-
请 注册 或 登录 后发表评论