作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command
33 protected $description = '升级项目统计'; 33 protected $description = '升级项目统计';
34 34
35 public function handle(){ 35 public function handle(){
36 - $project_id = 450; 36 + $project_id = 627;
37 ProjectServer::useProject($project_id); 37 ProjectServer::useProject($project_id);
38 $this->count($project_id); 38 $this->count($project_id);
39 DB::disconnect('custom_mysql'); 39 DB::disconnect('custom_mysql');
@@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command
36 protected $description = '升级项目统计'; 36 protected $description = '升级项目统计';
37 37
38 public function handle(){ 38 public function handle(){
39 - $project_id = 450; 39 + $project_id = 627;
40 $oldModel = new UpdateOldInfo(); 40 $oldModel = new UpdateOldInfo();
41 $info = $oldModel->read(['project_id'=>$project_id]); 41 $info = $oldModel->read(['project_id'=>$project_id]);
42 $url = $info['old_domain_online']; 42 $url = $info['old_domain_online'];
@@ -67,8 +67,9 @@ class UpgradeProjectCount extends Command @@ -67,8 +67,9 @@ class UpgradeProjectCount extends Command
67 $end = date('Y-m-t', strtotime($v['month'])); 67 $end = date('Y-m-t', strtotime($v['month']));
68 $arr['project_id'] = $project_id; 68 $arr['project_id'] = $project_id;
69 $res = $this->inquiry($url,$v['month']); 69 $res = $this->inquiry($url,$v['month']);
70 - $arr['month_total'] = 0; 70 +// $arr['month_total'] = 0;
71 if(isset($res['data']['count'])){ 71 if(isset($res['data']['count'])){
  72 + echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
72 $arr['month_total'] = $res['data']['count']; 73 $arr['month_total'] = $res['data']['count'];
73 //获取上一个的count 74 //获取上一个的count
74 $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month')); 75 $previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month'));
@@ -115,7 +116,6 @@ class UpgradeProjectCount extends Command @@ -115,7 +116,6 @@ class UpgradeProjectCount extends Command
115 ->first(); 116 ->first();
116 $arr['pv'] = $pv_ip->pv_num; 117 $arr['pv'] = $pv_ip->pv_num;
117 $arr['ip'] = $pv_ip->ip_num; 118 $arr['ip'] = $pv_ip->ip_num;
118 - $arr['month_total'] = $pv_ip->inquiry_num;  
119 if($arr['ip'] != 0){ 119 if($arr['ip'] != 0){
120 $arr['rate'] = round(($arr['month_total'] / $arr['ip']) * 10,2); 120 $arr['rate'] = round(($arr['month_total'] / $arr['ip']) * 10,2);
121 } 121 }