作者 lyh

gx

@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 namespace App\Console\Commands\DayCount; 10 namespace App\Console\Commands\DayCount;
11 11
  12 +use App\Models\Project\Project;
12 use App\Models\Visit\Visit; 13 use App\Models\Visit\Visit;
13 use App\Services\ProjectServer; 14 use App\Services\ProjectServer;
14 use Illuminate\Console\Command; 15 use Illuminate\Console\Command;
@@ -47,6 +48,8 @@ class UpgradeProjectCount extends Command @@ -47,6 +48,8 @@ class UpgradeProjectCount extends Command
47 public function count(){ 48 public function count(){
48 $list = DB::connection('custom_mysql')->table('gl_customer_visit')->select('updated_date') 49 $list = DB::connection('custom_mysql')->table('gl_customer_visit')->select('updated_date')
49 ->groupBy('updated_date')->get()->toArray(); 50 ->groupBy('updated_date')->get()->toArray();
  51 + $project = new Project();
  52 + $projectInfo = $project->read(['id'=>439]);
50 if(!empty($list)){ 53 if(!empty($list)){
51 $arr = []; 54 $arr = [];
52 foreach ($list as $k=>$v){ 55 foreach ($list as $k=>$v){
@@ -58,6 +61,10 @@ class UpgradeProjectCount extends Command @@ -58,6 +61,10 @@ class UpgradeProjectCount extends Command
58 $arr['pv_num'] = $this->pv_num($v['updated_date']); 61 $arr['pv_num'] = $this->pv_num($v['updated_date']);
59 $arr['ip_num'] = $this->ip_num($v['updated_date']); 62 $arr['ip_num'] = $this->ip_num($v['updated_date']);
60 $arr['inquiry_num'] = $this->inquiry_num($v['updated_date']); 63 $arr['inquiry_num'] = $this->inquiry_num($v['updated_date']);
  64 + //服务达标天数
  65 + $arr['compliance_day'] = $projectInfo['finish_remain_day'];
  66 + //剩余服务时常
  67 + $arr['service_day'] = $projectInfo['remain_day'];
61 $arr['country'] = '{"也门": 4, "印度": 3, "埃及": 4, "巴西": 1, "约旦": 2, "美国": 3, "伊拉克": 4, "利比亚": 2, "墨西哥": 5, "摩洛哥": 8, "新加坡": 1, "突尼斯": 3, "巴勒斯坦": 2, "巴基斯坦": 1, "罗马尼亚": 1, "非洲地区": 2, "马来西亚": 5, "印度尼西亚": 2, "沙特阿拉伯": 3, "阿尔及利亚": 2}'; 68 $arr['country'] = '{"也门": 4, "印度": 3, "埃及": 4, "巴西": 1, "约旦": 2, "美国": 3, "伊拉克": 4, "利比亚": 2, "墨西哥": 5, "摩洛哥": 8, "新加坡": 1, "突尼斯": 3, "巴勒斯坦": 2, "巴基斯坦": 1, "罗马尼亚": 1, "非洲地区": 2, "马来西亚": 5, "印度尼西亚": 2, "沙特阿拉伯": 3, "阿尔及利亚": 2}';
62 echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL; 69 echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL;
63 //查询当天数据是否存在 存在则更新 70 //查询当天数据是否存在 存在则更新