作者 lyh

gx

@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 namespace App\Console\Commands\MonthlyCount; 10 namespace App\Console\Commands\MonthlyCount;
11 11
  12 +use App\Models\HomeCount\MonthCount;
12 use App\Models\Project\Project; 13 use App\Models\Project\Project;
13 use App\Models\Visit\Visit; 14 use App\Models\Visit\Visit;
14 use App\Services\ProjectServer; 15 use App\Services\ProjectServer;
@@ -51,8 +52,12 @@ class UpgradeProjectCount extends Command @@ -51,8 +52,12 @@ class UpgradeProjectCount extends Command
51 ->groupBy('month')->get()->toArray(); 52 ->groupBy('month')->get()->toArray();
52 foreach ($list as $k=>$v){ 53 foreach ($list as $k=>$v){
53 $v = (array)$v; 54 $v = (array)$v;
  55 + $monthCountModel = new MonthCount();
  56 + $monthCountModel->read(['month'=>$v['month']]);
54 // 获取当月开始时间 57 // 获取当月开始时间
55 $start = date('Y-m-01', strtotime($v['month'])); 58 $start = date('Y-m-01', strtotime($v['month']));
  59 + echo date('Y-m-d H:i:s') . 'end'.$v['month'] . PHP_EOL;
  60 + return;
56 // 获取当月结束时间 61 // 获取当月结束时间
57 $end = date('Y-m-t', strtotime($v['month'])); 62 $end = date('Y-m-t', strtotime($v['month']));
58 $arr['project_id'] = 439; 63 $arr['project_id'] = 439;
@@ -61,7 +66,7 @@ class UpgradeProjectCount extends Command @@ -61,7 +66,7 @@ class UpgradeProjectCount extends Command
61 $arr['country'] = '{"\u5c3c\u65e5\u5229\u4e9a":1,"\u5370\u5ea6\u5c3c\u897f\u4e9a":1,"\u4f0a\u6717":1}'; 66 $arr['country'] = '{"\u5c3c\u65e5\u5229\u4e9a":1,"\u5370\u5ea6\u5c3c\u897f\u4e9a":1,"\u4f0a\u6717":1}';
62 $arr = $this->pv_ip($arr,$start,$end); 67 $arr = $this->pv_ip($arr,$start,$end);
63 $arr = $this->sourceCount($arr,$start,$end); 68 $arr = $this->sourceCount($arr,$start,$end);
64 - echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL; 69 +
65 } 70 }
66 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 71 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
67 } 72 }