正在显示
3 个修改的文件
包含
27 行增加
和
0 行删除
| @@ -98,6 +98,15 @@ class MonthAllCount extends Command | @@ -98,6 +98,15 @@ class MonthAllCount extends Command | ||
| 98 | }else{ | 98 | }else{ |
| 99 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | 99 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); |
| 100 | } | 100 | } |
| 101 | + }else{ | ||
| 102 | + //获取上一个的count | ||
| 103 | + $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); | ||
| 104 | + $previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]); | ||
| 105 | + if($previousInfo === false){ | ||
| 106 | + $arr['total'] = $arr['month_total']; | ||
| 107 | + }else{ | ||
| 108 | + $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | ||
| 109 | + } | ||
| 101 | } | 110 | } |
| 102 | //获取当月的其他询盘 | 111 | //获取当月的其他询盘 |
| 103 | $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); | 112 | $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); |
| @@ -121,6 +121,15 @@ class MonthCount extends Command | @@ -121,6 +121,15 @@ class MonthCount extends Command | ||
| 121 | }else{ | 121 | }else{ |
| 122 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | 122 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); |
| 123 | } | 123 | } |
| 124 | + }else{ | ||
| 125 | + //获取上一个的count | ||
| 126 | + $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); | ||
| 127 | + $previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]); | ||
| 128 | + if($previousInfo === false){ | ||
| 129 | + $arr['total'] = $arr['month_total']; | ||
| 130 | + }else{ | ||
| 131 | + $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | ||
| 132 | + } | ||
| 124 | } | 133 | } |
| 125 | //获取当月的其他询盘 | 134 | //获取当月的其他询盘 |
| 126 | $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); | 135 | $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); |
| @@ -87,6 +87,15 @@ class MonthProjectCount extends Command | @@ -87,6 +87,15 @@ class MonthProjectCount extends Command | ||
| 87 | }else{ | 87 | }else{ |
| 88 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | 88 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); |
| 89 | } | 89 | } |
| 90 | + }else{ | ||
| 91 | + //获取上一个的count | ||
| 92 | + $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); | ||
| 93 | + $previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]); | ||
| 94 | + if($previousInfo === false){ | ||
| 95 | + $arr['total'] = $arr['month_total']; | ||
| 96 | + }else{ | ||
| 97 | + $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | ||
| 98 | + } | ||
| 90 | } | 99 | } |
| 91 | //获取当月的其他询盘 | 100 | //获取当月的其他询盘 |
| 92 | $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); | 101 | $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); |
-
请 注册 或 登录 后发表评论