正在显示
1 个修改的文件
包含
19 行增加
和
18 行删除
| @@ -61,23 +61,24 @@ class UpgradeProjectCount extends Command | @@ -61,23 +61,24 @@ class UpgradeProjectCount extends Command | ||
| 61 | // 获取当月结束时间 | 61 | // 获取当月结束时间 |
| 62 | $end = date('Y-m-t', strtotime($v['month'])); | 62 | $end = date('Y-m-t', strtotime($v['month'])); |
| 63 | $arr['project_id'] = 439; | 63 | $arr['project_id'] = 439; |
| 64 | -// $inquiry_list = (new FormGlobalsoApi())->getInquiryList('www.cnzyl.com','',1,100000000); | ||
| 65 | -// //总数 | ||
| 66 | -// $arr['total'] = $inquiry_list['data']['total'] ?? 0; | ||
| 67 | - $this->inquiry('www.cnzyl.com',$v['month']); | ||
| 68 | -// $arr['month'] = $v['month']; | ||
| 69 | -// $arr['country'] = '{"\u5c3c\u65e5\u5229\u4e9a":1,"\u5370\u5ea6\u5c3c\u897f\u4e9a":1,"\u4f0a\u6717":1}'; | ||
| 70 | -// $arr = $this->pv_ip($arr,$start,$end); | ||
| 71 | -// $arr = $this->sourceCount($arr,$start,$end); | ||
| 72 | -// if($info === false){ | ||
| 73 | -// $selectedDate = $start; | ||
| 74 | -// $firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month")); | ||
| 75 | -// $arr['created_at'] = $firstDayOfNextMonth; | ||
| 76 | -// $arr['updated_at'] = $firstDayOfNextMonth; | ||
| 77 | -// $monthCountModel->insert($arr); | ||
| 78 | -// }else{ | ||
| 79 | -// $monthCountModel->edit($arr,['id'=>$info['id']]); | ||
| 80 | -// } | 64 | + $res = $this->inquiry('www.cnzyl.com',$v['month']); |
| 65 | + $arr['month_count'] = 0; | ||
| 66 | + if(isset($res['data']['count'])){ | ||
| 67 | + $arr['month_count'] = $res['data']['count']; | ||
| 68 | + } | ||
| 69 | + $arr['month'] = $v['month']; | ||
| 70 | + $arr['country'] = '{"\u5c3c\u65e5\u5229\u4e9a":1,"\u5370\u5ea6\u5c3c\u897f\u4e9a":1,"\u4f0a\u6717":1}'; | ||
| 71 | + $arr = $this->pv_ip($arr,$start,$end); | ||
| 72 | + $arr = $this->sourceCount($arr,$start,$end); | ||
| 73 | + if($info === false){ | ||
| 74 | + $selectedDate = $start; | ||
| 75 | + $firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month")); | ||
| 76 | + $arr['created_at'] = $firstDayOfNextMonth; | ||
| 77 | + $arr['updated_at'] = $firstDayOfNextMonth; | ||
| 78 | + $monthCountModel->insert($arr); | ||
| 79 | + }else{ | ||
| 80 | + $monthCountModel->edit($arr,['id'=>$info['id']]); | ||
| 81 | + } | ||
| 81 | } | 82 | } |
| 82 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 83 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 83 | } | 84 | } |
| @@ -150,7 +151,7 @@ class UpgradeProjectCount extends Command | @@ -150,7 +151,7 @@ class UpgradeProjectCount extends Command | ||
| 150 | $token = md5($url.date("Y-m-d")); | 151 | $token = md5($url.date("Y-m-d")); |
| 151 | $url = 'https://form.globalso.com/api/external-interface/country_con/15243d63ed5a5738?domain='.$url.'&token='.$token.'&source=1,2,3,4&model=month&sta_date='.$month; | 152 | $url = 'https://form.globalso.com/api/external-interface/country_con/15243d63ed5a5738?domain='.$url.'&token='.$token.'&source=1,2,3,4&model=month&sta_date='.$month; |
| 152 | $res = http_get($url,['charset=utf-8']); | 153 | $res = http_get($url,['charset=utf-8']); |
| 153 | - dd($res); | 154 | + return $res; |
| 154 | } | 155 | } |
| 155 | 156 | ||
| 156 | } | 157 | } |
-
请 注册 或 登录 后发表评论