正在显示
4 个修改的文件
包含
12 行增加
和
0 行删除
| @@ -408,6 +408,9 @@ class WebTraffic extends Command | @@ -408,6 +408,9 @@ class WebTraffic extends Command | ||
| 408 | $query->whereNotIn('ip_area', $main_countries); | 408 | $query->whereNotIn('ip_area', $main_countries); |
| 409 | } | 409 | } |
| 410 | })->inRandomOrder()->first(); | 410 | })->inRandomOrder()->first(); |
| 411 | + if(!$ipdata){ | ||
| 412 | + continue; | ||
| 413 | + } | ||
| 411 | $ipdata = (array)$ipdata ?: []; | 414 | $ipdata = (array)$ipdata ?: []; |
| 412 | $ipdata['diff'] = $time_zones[$ipdata['ip_area']]; | 415 | $ipdata['diff'] = $time_zones[$ipdata['ip_area']]; |
| 413 | $data[] = $ipdata; | 416 | $data[] = $ipdata; |
| @@ -454,6 +454,9 @@ class WebTrafficRussia extends Command | @@ -454,6 +454,9 @@ class WebTrafficRussia extends Command | ||
| 454 | } | 454 | } |
| 455 | $ip_area = $this->get_rand($project_country); | 455 | $ip_area = $this->get_rand($project_country); |
| 456 | $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first(); | 456 | $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first(); |
| 457 | + if(!$res){ | ||
| 458 | + continue; | ||
| 459 | + } | ||
| 457 | $res = (array)$res ?: []; | 460 | $res = (array)$res ?: []; |
| 458 | $res['diff'] = $time_zones[$res['ip_area']]; | 461 | $res['diff'] = $time_zones[$res['ip_area']]; |
| 459 | $data[] = $res; | 462 | $data[] = $res; |
| @@ -445,6 +445,9 @@ class WebTrafficRussiaSpecial extends Command | @@ -445,6 +445,9 @@ class WebTrafficRussiaSpecial extends Command | ||
| 445 | } | 445 | } |
| 446 | $ip_area = $this->get_rand($project_country); | 446 | $ip_area = $this->get_rand($project_country); |
| 447 | $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first(); | 447 | $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first(); |
| 448 | + if(!$res){ | ||
| 449 | + continue; | ||
| 450 | + } | ||
| 448 | $res = (array)$res ?: []; | 451 | $res = (array)$res ?: []; |
| 449 | $res['diff'] = $time_zones[$res['ip_area']]; | 452 | $res['diff'] = $time_zones[$res['ip_area']]; |
| 450 | $data[] = $res; | 453 | $data[] = $res; |
| @@ -395,6 +395,9 @@ class WebTrafficSpecial extends Command | @@ -395,6 +395,9 @@ class WebTrafficSpecial extends Command | ||
| 395 | $query->whereNotIn('ip_area', $main_countries); | 395 | $query->whereNotIn('ip_area', $main_countries); |
| 396 | } | 396 | } |
| 397 | })->inRandomOrder()->first(); | 397 | })->inRandomOrder()->first(); |
| 398 | + if(!$ipdata){ | ||
| 399 | + continue; | ||
| 400 | + } | ||
| 398 | $ipdata = (array)$ipdata ?: []; | 401 | $ipdata = (array)$ipdata ?: []; |
| 399 | $ipdata['diff'] = $time_zones[$ipdata['ip_area']]; | 402 | $ipdata['diff'] = $time_zones[$ipdata['ip_area']]; |
| 400 | $data[] = $ipdata; | 403 | $data[] = $ipdata; |
-
请 注册 或 登录 后发表评论