|
...
|
...
|
@@ -85,18 +85,18 @@ class MonthProjectCount extends Command |
|
|
|
$arr['total'] = $arr['month_total'] = 0;
|
|
|
|
if(isset($res['data']['count'])){
|
|
|
|
echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
|
|
|
|
$arr['month_total'] = $res['data']['count'];
|
|
|
|
$arr['month_total'] = $res['data']['count'] + InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']);
|
|
|
|
//获取上一个的count
|
|
|
|
$previousMonth = date('Y-m', strtotime($v . ' -1 month'));
|
|
|
|
$previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]);
|
|
|
|
if($previousInfo === false){
|
|
|
|
$arr['total'] = $arr['month_total'];
|
|
|
|
}else{
|
|
|
|
$arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0);
|
|
|
|
$arr['total'] = $arr['month_total'] + ($previousInfo['total'] ?? 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取当月的其他询盘
|
|
|
|
$arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']);
|
|
|
|
// $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']);
|
|
|
|
echo date('Y-m-d H:i:s') . '加上其他询盘:'.$arr['total'] . PHP_EOL;
|
|
|
|
$country = [];
|
|
|
|
if(isset($res['data']['data'])){
|
|
...
|
...
|
@@ -199,7 +199,13 @@ class MonthProjectCount extends Command |
|
|
|
return $res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :补齐月份
|
|
|
|
* @name :fillMissingMonths
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/8/14 11:11
|
|
|
|
*/
|
|
|
|
public function fillMissingMonths($dates) {
|
|
|
|
// 将字符串日期转换为 Carbon 对象
|
|
|
|
$carbonDates = array_map(function($date) {
|
...
|
...
|
|