正在显示
1 个修改的文件
包含
8 行增加
和
1 行删除
| @@ -66,7 +66,14 @@ class UpgradeProjectCount extends Command | @@ -66,7 +66,14 @@ class UpgradeProjectCount extends Command | ||
| 66 | $res = $this->inquiry($url,$v['month']); | 66 | $res = $this->inquiry($url,$v['month']); |
| 67 | $arr['month_total'] = 0; | 67 | $arr['month_total'] = 0; |
| 68 | if(isset($res['data']['count'])){ | 68 | if(isset($res['data']['count'])){ |
| 69 | - $arr['month_total'] = $res['data']['count']; | 69 | + //获取上一个的count |
| 70 | + $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); | ||
| 71 | + $previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]); | ||
| 72 | + if($previousInfo === false){ | ||
| 73 | + $arr['month_total'] = $res['data']['count']; | ||
| 74 | + }else{ | ||
| 75 | + $arr['month_total'] = $res['data']['count'] + $previousInfo['month_total'] ?? 0; | ||
| 76 | + } | ||
| 70 | } | 77 | } |
| 71 | if(isset($res['data']['data'])){ | 78 | if(isset($res['data']['data'])){ |
| 72 | $arr['country'] = json_encode($res['data']['data']); | 79 | $arr['country'] = json_encode($res['data']['data']); |
-
请 注册 或 登录 后发表评论