作者 lyh

gx

... ... @@ -98,11 +98,7 @@ class MonthCount extends Command
* @time :2024/1/8 9:05
*/
public function count($project_id,$url){
$list = DB::connection('custom_mysql')->table('gl_customer_visit')
->select(DB::raw("DATE_FORMAT(updated_date, '%Y-%m') as month"))
->groupBy('month')->get()->toArray();
foreach ($list as $k=>$v){
$v = (array)$v;
$v = ['month'=>date('Y-m')];
$monthCountModel = new MonthCountModel();
$info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]);
// 获取当月开始时间
... ... @@ -140,7 +136,6 @@ class MonthCount extends Command
}else{
$monthCountModel->edit($arr,['id'=>$info['id']]);
}
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ...