|
...
|
...
|
@@ -72,12 +72,18 @@ class UpgradeProjectCount extends Command |
|
|
|
* @time :2024/1/8 9:29
|
|
|
|
*/
|
|
|
|
public function country20Top($day){
|
|
|
|
$country = DB::connection('custom_mysql')->table('gl_customer_visit')
|
|
|
|
$country = [];
|
|
|
|
$data = DB::connection('custom_mysql')->table('gl_customer_visit')
|
|
|
|
->whereDate('updated_date', $day)->where('is_inquiry',1)
|
|
|
|
->select('country', DB::raw('COUNT(*) as count'))
|
|
|
|
->groupBy('country')
|
|
|
|
->orderByDesc('count')->limit(20)->get()->toArray();
|
|
|
|
echo date('Y-m-d H:i:s') . 'shuju:'.json_encode($country) . PHP_EOL;
|
|
|
|
if(!empty($data)){
|
|
|
|
foreach ($data as $v){
|
|
|
|
$country[$v['country']] = $v['count'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo date('Y-m-d H:i:s') . 'shuju:'.json_encode($country) . PHP_EOL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|