正在显示
3 个修改的文件
包含
4 行增加
和
7 行删除
| @@ -77,9 +77,7 @@ class MonthAllCount extends Command | @@ -77,9 +77,7 @@ class MonthAllCount extends Command | ||
| 77 | ->groupBy('month')->get()->toArray(); | 77 | ->groupBy('month')->get()->toArray(); |
| 78 | foreach ($list as $k=>$v){ | 78 | foreach ($list as $k=>$v){ |
| 79 | $v = (array)$v; | 79 | $v = (array)$v; |
| 80 | - if($v['month'] == date('Y-m')){ | ||
| 81 | - continue; | ||
| 82 | - } | 80 | + $arr = []; |
| 83 | $monthCountModel = new MonthCount(); | 81 | $monthCountModel = new MonthCount(); |
| 84 | $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); | 82 | $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); |
| 85 | // 获取当月开始时间 | 83 | // 获取当月开始时间 |
| @@ -88,7 +86,7 @@ class MonthAllCount extends Command | @@ -88,7 +86,7 @@ class MonthAllCount extends Command | ||
| 88 | $end = date('Y-m-t', strtotime($v['month'])); | 86 | $end = date('Y-m-t', strtotime($v['month'])); |
| 89 | $arr['project_id'] = $project_id; | 87 | $arr['project_id'] = $project_id; |
| 90 | $res = $this->inquiry($url,$v['month']); | 88 | $res = $this->inquiry($url,$v['month']); |
| 91 | - $arr['total'] = 0; | 89 | + |
| 92 | if(isset($res['data']['count'])){ | 90 | if(isset($res['data']['count'])){ |
| 93 | echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL; | 91 | echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL; |
| 94 | $arr['month_total'] = $res['data']['count']; | 92 | $arr['month_total'] = $res['data']['count']; |
| @@ -99,6 +99,7 @@ class MonthCount extends Command | @@ -99,6 +99,7 @@ class MonthCount extends Command | ||
| 99 | * @time :2024/1/8 9:05 | 99 | * @time :2024/1/8 9:05 |
| 100 | */ | 100 | */ |
| 101 | public function count($project_id,$url){ | 101 | public function count($project_id,$url){ |
| 102 | + $arr = []; | ||
| 102 | $v = ['month'=>date('Y-m')]; | 103 | $v = ['month'=>date('Y-m')]; |
| 103 | $monthCountModel = new MonthCountModel(); | 104 | $monthCountModel = new MonthCountModel(); |
| 104 | $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); | 105 | $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); |
| @@ -65,10 +65,8 @@ class MonthProjectCount extends Command | @@ -65,10 +65,8 @@ class MonthProjectCount extends Command | ||
| 65 | ->select(DB::raw('DATE_FORMAT(updated_date, "%Y-%m") as month')) | 65 | ->select(DB::raw('DATE_FORMAT(updated_date, "%Y-%m") as month')) |
| 66 | ->groupBy('month')->get()->toArray(); | 66 | ->groupBy('month')->get()->toArray(); |
| 67 | foreach ($list as $k=>$v){ | 67 | foreach ($list as $k=>$v){ |
| 68 | + $arr = []; | ||
| 68 | $v = (array)$v; | 69 | $v = (array)$v; |
| 69 | -// if($v['month'] == date('Y-m')){ | ||
| 70 | -// continue; | ||
| 71 | -// } | ||
| 72 | $monthCountModel = new MonthCount(); | 70 | $monthCountModel = new MonthCount(); |
| 73 | $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); | 71 | $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); |
| 74 | // 获取当月开始时间 | 72 | // 获取当月开始时间 |
-
请 注册 或 登录 后发表评论