Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
6 个修改的文件
包含
190 行增加
和
40 行删除
| @@ -5,6 +5,7 @@ namespace App\Console\Commands\DayCount; | @@ -5,6 +5,7 @@ namespace App\Console\Commands\DayCount; | ||
| 5 | use App\Helper\Common; | 5 | use App\Helper\Common; |
| 6 | use App\Helper\FormGlobalsoApi; | 6 | use App\Helper\FormGlobalsoApi; |
| 7 | use App\Models\Domain\DomainInfo; | 7 | use App\Models\Domain\DomainInfo; |
| 8 | +use App\Models\Inquiry\InquiryForm; | ||
| 8 | use App\Models\Inquiry\InquiryFormData; | 9 | use App\Models\Inquiry\InquiryFormData; |
| 9 | use App\Models\Project\DeployBuild; | 10 | use App\Models\Project\DeployBuild; |
| 10 | use App\Models\Project\DeployOptimize; | 11 | use App\Models\Project\DeployOptimize; |
| @@ -9,6 +9,8 @@ | @@ -9,6 +9,8 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Console\Commands\DayCount; | 10 | namespace App\Console\Commands\DayCount; |
| 11 | 11 | ||
| 12 | +use App\Helper\FormGlobalsoApi; | ||
| 13 | +use App\Models\Inquiry\InquiryFormData; | ||
| 12 | use App\Models\Project\Project; | 14 | use App\Models\Project\Project; |
| 13 | use App\Models\Visit\Visit; | 15 | use App\Models\Visit\Visit; |
| 14 | use App\Services\ProjectServer; | 16 | use App\Services\ProjectServer; |
| @@ -18,6 +20,7 @@ use App\Models\HomeCount\Count; | @@ -18,6 +20,7 @@ use App\Models\HomeCount\Count; | ||
| 18 | 20 | ||
| 19 | class UpgradeCount extends Command | 21 | class UpgradeCount extends Command |
| 20 | { | 22 | { |
| 23 | + | ||
| 21 | /** | 24 | /** |
| 22 | * The name and signature of the console command. | 25 | * The name and signature of the console command. |
| 23 | * | 26 | * |
| @@ -90,6 +93,52 @@ class UpgradeCount extends Command | @@ -90,6 +93,52 @@ class UpgradeCount extends Command | ||
| 90 | } | 93 | } |
| 91 | 94 | ||
| 92 | /** | 95 | /** |
| 96 | + * @param $arr | ||
| 97 | + * @param $domain | ||
| 98 | + * @name :(询盘统计)inquiry | ||
| 99 | + * @author :lyh | ||
| 100 | + * @method :post | ||
| 101 | + * @time :2023/6/14 15:44 | ||
| 102 | + */ | ||
| 103 | + public function inquiry($arr,$domain,$project_id){ | ||
| 104 | + $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); | ||
| 105 | + if($inquiry_list == false){ | ||
| 106 | + return false; | ||
| 107 | + } | ||
| 108 | + if($inquiry_list['status'] == self::STATUS_ERROR){ | ||
| 109 | + $arr['inquiry_num'] = 0; | ||
| 110 | + $countryArr = []; | ||
| 111 | + }else{ | ||
| 112 | + $arr['inquiry_num'] = $inquiry_list['data']['total']; | ||
| 113 | + //询盘国家统计 | ||
| 114 | + $countryData = $inquiry_list['data']['data']; | ||
| 115 | + $countryArr = []; | ||
| 116 | + foreach ($countryData as $v1){ | ||
| 117 | + if(isset($countryArr[$v1['country']])){ | ||
| 118 | + $countryArr[$v1['country']]++; | ||
| 119 | + }else{ | ||
| 120 | + $countryArr[$v1['country']] = 1; | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + //加上其他询盘 | ||
| 125 | + ProjectServer::useProject($project_id); | ||
| 126 | + $arr['inquiry_num'] += InquiryFormData::getCount(); | ||
| 127 | + $countryData = InquiryFormData::getCountryCount(); | ||
| 128 | + foreach ($countryData as $v1){ | ||
| 129 | + if(isset($countryArr[$v1['country']])){ | ||
| 130 | + $countryArr[$v1['country']] += $v1['count']; | ||
| 131 | + }else{ | ||
| 132 | + $countryArr[$v1['country']] = $v1['count']; | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | + arsort($countryArr); | ||
| 136 | + $top20 = array_slice($countryArr, 0, 20, true); | ||
| 137 | + $arr['country'] = json_encode($top20); | ||
| 138 | + return $arr; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + /** | ||
| 93 | * @remark :询盘数量 | 142 | * @remark :询盘数量 |
| 94 | * @name :inquiry_num | 143 | * @name :inquiry_num |
| 95 | * @author :lyh | 144 | * @author :lyh |
| @@ -9,6 +9,10 @@ | @@ -9,6 +9,10 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Console\Commands\DayCount; | 10 | namespace App\Console\Commands\DayCount; |
| 11 | 11 | ||
| 12 | +use App\Helper\FormGlobalsoApi; | ||
| 13 | +use App\Models\Domain\DomainInfo; | ||
| 14 | +use App\Models\Inquiry\InquiryFormData; | ||
| 15 | +use App\Models\Project\DeployOptimize; | ||
| 12 | use App\Models\Project\Project; | 16 | use App\Models\Project\Project; |
| 13 | use App\Models\Visit\Visit; | 17 | use App\Models\Visit\Visit; |
| 14 | use App\Services\ProjectServer; | 18 | use App\Services\ProjectServer; |
| @@ -18,6 +22,8 @@ use App\Models\HomeCount\Count; | @@ -18,6 +22,8 @@ use App\Models\HomeCount\Count; | ||
| 18 | 22 | ||
| 19 | class UpgradeProjectCount extends Command | 23 | class UpgradeProjectCount extends Command |
| 20 | { | 24 | { |
| 25 | + const STATUS_ERROR = 400; | ||
| 26 | + public $error = 0; | ||
| 21 | /** | 27 | /** |
| 22 | * The name and signature of the console command. | 28 | * The name and signature of the console command. |
| 23 | * | 29 | * |
| @@ -51,6 +57,19 @@ class UpgradeProjectCount extends Command | @@ -51,6 +57,19 @@ class UpgradeProjectCount extends Command | ||
| 51 | ->groupBy('updated_date')->get()->toArray(); | 57 | ->groupBy('updated_date')->get()->toArray(); |
| 52 | $project = new Project(); | 58 | $project = new Project(); |
| 53 | $projectInfo = $project->read(['id'=>$project_id]); | 59 | $projectInfo = $project->read(['id'=>$project_id]); |
| 60 | + $projectOptimizeModel = new DeployOptimize(); | ||
| 61 | + $optimizeInfo = $projectOptimizeModel->read(['project_id'=>$project_id]); | ||
| 62 | + $domain = ''; | ||
| 63 | + if(!empty($optimizeInfo['domain'])){ | ||
| 64 | + $domainInfo = new DomainInfo(); | ||
| 65 | + $info = $domainInfo->read(['id'=>$optimizeInfo['domain']]); | ||
| 66 | + if($info !== false){ | ||
| 67 | + $domain = $info['domain']; | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + if(empty($domain)){ | ||
| 71 | + return false; | ||
| 72 | + } | ||
| 54 | if(!empty($list)){ | 73 | if(!empty($list)){ |
| 55 | $arr = []; | 74 | $arr = []; |
| 56 | foreach ($list as $k=>$v){ | 75 | foreach ($list as $k=>$v){ |
| @@ -64,12 +83,11 @@ class UpgradeProjectCount extends Command | @@ -64,12 +83,11 @@ class UpgradeProjectCount extends Command | ||
| 64 | $arr['date'] = $v['updated_date']; | 83 | $arr['date'] = $v['updated_date']; |
| 65 | $arr['pv_num'] = $this->pv_num($v['updated_date']); | 84 | $arr['pv_num'] = $this->pv_num($v['updated_date']); |
| 66 | $arr['ip_num'] = $this->ip_num($v['updated_date']); | 85 | $arr['ip_num'] = $this->ip_num($v['updated_date']); |
| 67 | - $arr['inquiry_num'] = $this->inquiry_num($v['updated_date']); | ||
| 68 | //服务达标天数 | 86 | //服务达标天数 |
| 69 | $arr['compliance_day'] = $projectInfo['finish_remain_day']; | 87 | $arr['compliance_day'] = $projectInfo['finish_remain_day']; |
| 70 | //剩余服务时常 | 88 | //剩余服务时常 |
| 71 | $arr['service_day'] = $projectInfo['remain_day']; | 89 | $arr['service_day'] = $projectInfo['remain_day']; |
| 72 | - $arr['country'] = json_encode([]); | 90 | + $arr = $this->inquiry($arr,$domain, $project_id); |
| 73 | //查询当天数据是否存在 存在则更新 | 91 | //查询当天数据是否存在 存在则更新 |
| 74 | $info = $count->read(['date'=>$v['updated_date'],'project_id'=>$project_id]); | 92 | $info = $count->read(['date'=>$v['updated_date'],'project_id'=>$project_id]); |
| 75 | if($info === false){ | 93 | if($info === false){ |
| @@ -103,7 +121,6 @@ class UpgradeProjectCount extends Command | @@ -103,7 +121,6 @@ class UpgradeProjectCount extends Command | ||
| 103 | * @time :2023/6/14 15:40 | 121 | * @time :2023/6/14 15:40 |
| 104 | */ | 122 | */ |
| 105 | public function pv_num($day){ | 123 | public function pv_num($day){ |
| 106 | - //$pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $day)->count(); | ||
| 107 | $pv = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $day)->sum('depth'); | 124 | $pv = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $day)->sum('depth'); |
| 108 | return $pv; | 125 | return $pv; |
| 109 | } | 126 | } |
| @@ -119,6 +136,50 @@ class UpgradeProjectCount extends Command | @@ -119,6 +136,50 @@ class UpgradeProjectCount extends Command | ||
| 119 | return $ip; | 136 | return $ip; |
| 120 | } | 137 | } |
| 121 | 138 | ||
| 122 | - | 139 | + /** |
| 140 | + * @param $arr | ||
| 141 | + * @param $domain | ||
| 142 | + * @name :(询盘统计)inquiry | ||
| 143 | + * @author :lyh | ||
| 144 | + * @method :post | ||
| 145 | + * @time :2023/6/14 15:44 | ||
| 146 | + */ | ||
| 147 | + public function inquiry($arr,$domain,$project_id){ | ||
| 148 | + $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000); | ||
| 149 | + if($inquiry_list == false){ | ||
| 150 | + return false; | ||
| 151 | + } | ||
| 152 | + if($inquiry_list['status'] == self::STATUS_ERROR){ | ||
| 153 | + $arr['inquiry_num'] = 0; | ||
| 154 | + $countryArr = []; | ||
| 155 | + }else{ | ||
| 156 | + $arr['inquiry_num'] = $inquiry_list['data']['total']; | ||
| 157 | + //询盘国家统计 | ||
| 158 | + $countryData = $inquiry_list['data']['data']; | ||
| 159 | + $countryArr = []; | ||
| 160 | + foreach ($countryData as $v1){ | ||
| 161 | + if(isset($countryArr[$v1['country']])){ | ||
| 162 | + $countryArr[$v1['country']]++; | ||
| 163 | + }else{ | ||
| 164 | + $countryArr[$v1['country']] = 1; | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + //加上其他询盘 | ||
| 169 | + ProjectServer::useProject($project_id); | ||
| 170 | + $arr['inquiry_num'] += InquiryFormData::getCount(); | ||
| 171 | + $countryData = InquiryFormData::getCountryCount(); | ||
| 172 | + foreach ($countryData as $v1){ | ||
| 173 | + if(isset($countryArr[$v1['country']])){ | ||
| 174 | + $countryArr[$v1['country']] += $v1['count']; | ||
| 175 | + }else{ | ||
| 176 | + $countryArr[$v1['country']] = $v1['count']; | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + arsort($countryArr); | ||
| 180 | + $top20 = array_slice($countryArr, 0, 20, true); | ||
| 181 | + $arr['country'] = json_encode($top20); | ||
| 182 | + return $arr; | ||
| 183 | + } | ||
| 123 | 184 | ||
| 124 | } | 185 | } |
| @@ -11,6 +11,7 @@ namespace App\Console\Commands\MonthlyCount; | @@ -11,6 +11,7 @@ namespace App\Console\Commands\MonthlyCount; | ||
| 11 | 11 | ||
| 12 | use App\Models\Com\UpdateOldInfo; | 12 | use App\Models\Com\UpdateOldInfo; |
| 13 | use App\Models\Domain\DomainInfo; | 13 | use App\Models\Domain\DomainInfo; |
| 14 | +use App\Models\Inquiry\InquiryFormData; | ||
| 14 | use App\Models\Project\Project; | 15 | use App\Models\Project\Project; |
| 15 | use App\Services\ProjectServer; | 16 | use App\Services\ProjectServer; |
| 16 | use Illuminate\Console\Command; | 17 | use Illuminate\Console\Command; |
| @@ -98,44 +99,56 @@ class MonthCount extends Command | @@ -98,44 +99,56 @@ class MonthCount extends Command | ||
| 98 | * @time :2024/1/8 9:05 | 99 | * @time :2024/1/8 9:05 |
| 99 | */ | 100 | */ |
| 100 | public function count($project_id,$url){ | 101 | public function count($project_id,$url){ |
| 101 | - $v = ['month'=>date('Y-m')]; | ||
| 102 | - $monthCountModel = new MonthCountModel(); | ||
| 103 | - $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); | ||
| 104 | - // 获取当月开始时间 | ||
| 105 | - $start = date('Y-m-01', strtotime($v['month'])); | ||
| 106 | - // 获取当月结束时间 | ||
| 107 | - $end = date('Y-m-t', strtotime($v['month'])); | ||
| 108 | - $arr['project_id'] = $project_id; | ||
| 109 | - $res = $this->inquiry($url,$v['month']); | 102 | + $v = ['month'=>date('Y-m')]; |
| 103 | + $monthCountModel = new MonthCountModel(); | ||
| 104 | + $info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]); | ||
| 105 | + // 获取当月开始时间 | ||
| 106 | + $start = date('Y-m-01', strtotime($v['month'])); | ||
| 107 | + // 获取当月结束时间 | ||
| 108 | + $end = date('Y-m-t', strtotime($v['month'])); | ||
| 109 | + $arr['project_id'] = $project_id; | ||
| 110 | + $res = $this->inquiry($url,$v['month']); | ||
| 110 | // $arr['month_total'] = 0; | 111 | // $arr['month_total'] = 0; |
| 111 | - if(isset($res['data']['count'])){ | ||
| 112 | - echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL; | ||
| 113 | - $arr['month_total'] = $res['data']['count']; | ||
| 114 | - //获取上一个的count | ||
| 115 | - $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); | ||
| 116 | - $previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]); | ||
| 117 | - if($previousInfo === false){ | ||
| 118 | - $arr['total'] = $arr['month_total']; | ||
| 119 | - }else{ | ||
| 120 | - $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | ||
| 121 | - } | ||
| 122 | - } | ||
| 123 | - if(isset($res['data']['data'])){ | ||
| 124 | - $arr['country'] = json_encode($res['data']['data']); | 112 | + if(isset($res['data']['count'])){ |
| 113 | + echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL; | ||
| 114 | + $arr['month_total'] = $res['data']['count']; | ||
| 115 | + //获取上一个的count | ||
| 116 | + $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); | ||
| 117 | + $previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]); | ||
| 118 | + if($previousInfo === false){ | ||
| 119 | + $arr['total'] = $arr['month_total']; | ||
| 120 | + }else{ | ||
| 121 | + $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | ||
| 125 | } | 122 | } |
| 126 | - $arr['month'] = $v['month']; | ||
| 127 | - $arr = $this->pv_ip($arr,$start,$end,$project_id); | ||
| 128 | - $arr = $this->sourceCount($arr,$start,$end); | ||
| 129 | - if($info === false){ | ||
| 130 | - $selectedDate = $start; | ||
| 131 | - $firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month")); | ||
| 132 | - $arr['created_at'] = $firstDayOfNextMonth; | ||
| 133 | - $arr['updated_at'] = $firstDayOfNextMonth; | ||
| 134 | -// echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL; | ||
| 135 | - $monthCountModel->insert($arr); | 123 | + } |
| 124 | + //获取当月的其他询盘 | ||
| 125 | + $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); | ||
| 126 | + $country = []; | ||
| 127 | + if(isset($res['data']['data'])){ | ||
| 128 | + $country = $res['data']['data']; | ||
| 129 | + } | ||
| 130 | + $countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']); | ||
| 131 | + foreach ($countryData as $v1){ | ||
| 132 | + if(isset($country[$v1['country']])){ | ||
| 133 | + $country[$v1['country']] += $v1['count']; | ||
| 136 | }else{ | 134 | }else{ |
| 137 | - $monthCountModel->edit($arr,['id'=>$info['id']]); | 135 | + $country[$v1['country']] = $v1['count']; |
| 138 | } | 136 | } |
| 137 | + } | ||
| 138 | + $arr['country'] = json_encode($country); | ||
| 139 | + $arr['month'] = $v['month']; | ||
| 140 | + $arr = $this->pv_ip($arr,$start,$end,$project_id); | ||
| 141 | + $arr = $this->sourceCount($arr,$start,$end); | ||
| 142 | + if($info === false){ | ||
| 143 | + $selectedDate = $start; | ||
| 144 | + $firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month")); | ||
| 145 | + $arr['created_at'] = $firstDayOfNextMonth; | ||
| 146 | + $arr['updated_at'] = $firstDayOfNextMonth; | ||
| 147 | +// echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL; | ||
| 148 | + $monthCountModel->insert($arr); | ||
| 149 | + }else{ | ||
| 150 | + $monthCountModel->edit($arr,['id'=>$info['id']]); | ||
| 151 | + } | ||
| 139 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 152 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 140 | } | 153 | } |
| 141 | 154 |
| @@ -13,6 +13,7 @@ use App\Helper\FormGlobalsoApi; | @@ -13,6 +13,7 @@ use App\Helper\FormGlobalsoApi; | ||
| 13 | use App\Models\Com\UpdateOldInfo; | 13 | use App\Models\Com\UpdateOldInfo; |
| 14 | use App\Models\Domain\DomainInfo; | 14 | use App\Models\Domain\DomainInfo; |
| 15 | use App\Models\HomeCount\MonthCount; | 15 | use App\Models\HomeCount\MonthCount; |
| 16 | +use App\Models\Inquiry\InquiryFormData; | ||
| 16 | use App\Models\Project\Project; | 17 | use App\Models\Project\Project; |
| 17 | use App\Models\Visit\Visit; | 18 | use App\Models\Visit\Visit; |
| 18 | use App\Services\ProjectServer; | 19 | use App\Services\ProjectServer; |
| @@ -91,9 +92,21 @@ class UpgradeCount extends Command | @@ -91,9 +92,21 @@ class UpgradeCount extends Command | ||
| 91 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | 92 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); |
| 92 | } | 93 | } |
| 93 | } | 94 | } |
| 95 | + //获取当月的其他询盘 | ||
| 96 | + $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); | ||
| 97 | + $country = []; | ||
| 94 | if(isset($res['data']['data'])){ | 98 | if(isset($res['data']['data'])){ |
| 95 | - $arr['country'] = json_encode($res['data']['data']); | 99 | + $country = $res['data']['data']; |
| 96 | } | 100 | } |
| 101 | + $countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']); | ||
| 102 | + foreach ($countryData as $v1){ | ||
| 103 | + if(isset($country[$v1['country']])){ | ||
| 104 | + $country[$v1['country']] += $v1['count']; | ||
| 105 | + }else{ | ||
| 106 | + $country[$v1['country']] = $v1['count']; | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + $arr['country'] = json_encode($country); | ||
| 97 | $arr['month'] = $v['month']; | 110 | $arr['month'] = $v['month']; |
| 98 | $arr = $this->pv_ip($arr,$start,$end,$project_id); | 111 | $arr = $this->pv_ip($arr,$start,$end,$project_id); |
| 99 | $arr = $this->sourceCount($arr,$start,$end); | 112 | $arr = $this->sourceCount($arr,$start,$end); |
| @@ -13,6 +13,7 @@ use App\Helper\FormGlobalsoApi; | @@ -13,6 +13,7 @@ use App\Helper\FormGlobalsoApi; | ||
| 13 | use App\Models\Com\UpdateOldInfo; | 13 | use App\Models\Com\UpdateOldInfo; |
| 14 | use App\Models\Domain\DomainInfo; | 14 | use App\Models\Domain\DomainInfo; |
| 15 | use App\Models\HomeCount\MonthCount; | 15 | use App\Models\HomeCount\MonthCount; |
| 16 | +use App\Models\Inquiry\InquiryFormData; | ||
| 16 | use App\Models\Project\Project; | 17 | use App\Models\Project\Project; |
| 17 | use App\Models\Visit\Visit; | 18 | use App\Models\Visit\Visit; |
| 18 | use App\Services\ProjectServer; | 19 | use App\Services\ProjectServer; |
| @@ -89,9 +90,21 @@ class UpgradeProjectCount extends Command | @@ -89,9 +90,21 @@ class UpgradeProjectCount extends Command | ||
| 89 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); | 90 | $arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0); |
| 90 | } | 91 | } |
| 91 | } | 92 | } |
| 93 | + //获取当月的其他询盘 | ||
| 94 | + $arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']); | ||
| 95 | + $country = []; | ||
| 92 | if(isset($res['data']['data'])){ | 96 | if(isset($res['data']['data'])){ |
| 93 | - $arr['country'] = json_encode($res['data']['data']); | 97 | + $country = $res['data']['data']; |
| 94 | } | 98 | } |
| 99 | + $countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']); | ||
| 100 | + foreach ($countryData as $v1){ | ||
| 101 | + if(isset($country[$v1['country']])){ | ||
| 102 | + $country[$v1['country']] += $v1['count']; | ||
| 103 | + }else{ | ||
| 104 | + $country[$v1['country']] = $v1['count']; | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + $arr['country'] = json_encode($country); | ||
| 95 | $arr['month'] = $v['month']; | 108 | $arr['month'] = $v['month']; |
| 96 | $arr = $this->pv_ip($arr,$start,$end,$project_id); | 109 | $arr = $this->pv_ip($arr,$start,$end,$project_id); |
| 97 | $arr = $this->sourceCount($arr,$start,$end); | 110 | $arr = $this->sourceCount($arr,$start,$end); |
-
请 注册 或 登录 后发表评论