作者 lyh

gx数据

@@ -65,9 +65,9 @@ class Count extends Command @@ -65,9 +65,9 @@ class Count extends Command
65 $arr['date'] = $yesterday; 65 $arr['date'] = $yesterday;
66 ProjectServer::useProject($v['id']); 66 ProjectServer::useProject($v['id']);
67 //pv统计 67 //pv统计
68 - $arr['pv_num'] = $this->pv_num($yesterday,$v['test_domain']); 68 + $arr['pv_num'] = $this->pv_num($yesterday);
69 //ip统计 69 //ip统计
70 - $arr['ip_num'] = $this->ip_num($yesterday,$v['test_domain']); 70 + $arr['ip_num'] = $this->ip_num($yesterday);
71 DB::disconnect('custom_mysql'); 71 DB::disconnect('custom_mysql');
72 //服务达标天数 72 //服务达标天数
73 $arr['compliance_day'] = $v['finish_remain_day']; 73 $arr['compliance_day'] = $v['finish_remain_day'];
@@ -66,9 +66,9 @@ class CountDate extends Command @@ -66,9 +66,9 @@ class CountDate extends Command
66 $arr['date'] = $yesterday; 66 $arr['date'] = $yesterday;
67 ProjectServer::useProject($v['id']); 67 ProjectServer::useProject($v['id']);
68 //pv统计 68 //pv统计
69 - $arr['pv_num'] = $this->pv_num($yesterday,$v['test_domain']); 69 + $arr['pv_num'] = $this->pv_num($yesterday);
70 //ip统计 70 //ip统计
71 - $arr['ip_num'] = $this->ip_num($yesterday,$v['test_domain']); 71 + $arr['ip_num'] = $this->ip_num($yesterday);
72 DB::disconnect('custom_mysql'); 72 DB::disconnect('custom_mysql');
73 //服务达标天数 73 //服务达标天数
74 $arr['compliance_day'] = $v['finish_remain_day']; 74 $arr['compliance_day'] = $v['finish_remain_day'];
@@ -39,7 +39,7 @@ class TemplateLabel extends Command @@ -39,7 +39,7 @@ class TemplateLabel extends Command
39 */ 39 */
40 public function handle(){ 40 public function handle(){
41 //获取最近7天模版的记录 41 //获取最近7天模版的记录
42 - $start_time = now()->subDays(90)->startOfDay()->toDateString(); 42 + $start_time = now()->subDays(7)->startOfDay()->toDateString();
43 $end_time = now()->startOfDay()->toDateString(); 43 $end_time = now()->startOfDay()->toDateString();
44 $this->setTemplateModule($start_time,$end_time); 44 $this->setTemplateModule($start_time,$end_time);
45 $this->setTemplate($start_time,$end_time); 45 $this->setTemplate($start_time,$end_time);
@@ -38,6 +38,8 @@ use App\Models\Purchaser\PurchaserInfo; @@ -38,6 +38,8 @@ use App\Models\Purchaser\PurchaserInfo;
38 use App\Models\RouteMap\RouteMap; 38 use App\Models\RouteMap\RouteMap;
39 use App\Models\Template\BCustomTemplate; 39 use App\Models\Template\BCustomTemplate;
40 use App\Models\Template\BTemplateCom; 40 use App\Models\Template\BTemplateCom;
  41 +use App\Models\Template\Setting;
  42 +use App\Models\Template\Template;
41 use App\Services\AmazonS3Service; 43 use App\Services\AmazonS3Service;
42 use App\Services\ProjectServer; 44 use App\Services\ProjectServer;
43 use App\Utils\EncryptUtils; 45 use App\Utils\EncryptUtils;
@@ -65,15 +67,33 @@ class Demo extends Command @@ -65,15 +67,33 @@ class Demo extends Command
65 67
66 public function handle(){ 68 public function handle(){
67 69
68 - echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL;  
69 - ProjectServer::useProject(2837);  
70 - $this->ceshi();  
71 - DB::disconnect('custom_mysql');  
72 - 70 +// echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL;
  71 +// ProjectServer::useProject(2837);
  72 +// $this->ceshi();
  73 +// DB::disconnect('custom_mysql');
  74 + $this->countTemplate();
73 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 75 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
74 } 76 }
75 77
76 /** 78 /**
  79 + * @remark :统计当前模版使用情况
  80 + * @name :countTemplate
  81 + * @author :lyh
  82 + * @method :post
  83 + * @time :2025/1/9 10:59
  84 + */
  85 + public function countTemplate(){
  86 + $bSettingModel = new Setting();
  87 + $lists = $bSettingModel->list();
  88 + $templateModel = new Template();
  89 + foreach ($lists as $v){
  90 + echo date('Y-m-d H:i:s') . '执行的模版id:' .$v['template_id'] . PHP_EOL;
  91 + $templateModel->where(['id'=>$v['template_id']])->increment('total',1);
  92 + }
  93 + return true;
  94 + }
  95 +
  96 + /**
77 * @remark :更新产品 97 * @remark :更新产品
78 * @name :getProduct 98 * @name :getProduct
79 * @author :lyh 99 * @author :lyh
@@ -187,9 +187,12 @@ class ATemplateLogic extends BaseLogic @@ -187,9 +187,12 @@ class ATemplateLogic extends BaseLogic
187 'template_id'=>$this->param['template_id'], 187 'template_id'=>$this->param['template_id'],
188 ]; 188 ];
189 $rs = $bSettingModel->add($param); 189 $rs = $bSettingModel->add($param);
  190 +
190 }else{ 191 }else{
  192 + $this->model->where(['id'=>$info['template_id']])->decrement('number',1);
191 $rs = $bSettingModel->edit(['template_id'=>$this->param['template_id']],['id'=>$info['id']]); 193 $rs = $bSettingModel->edit(['template_id'=>$this->param['template_id']],['id'=>$info['id']]);
192 } 194 }
  195 + $this->model->where(['id'=>$this->param['template_id']])->increment('number',1);
193 $this->saveTemplate($this->param['project_id'],$this->param['template_id']); 196 $this->saveTemplate($this->param['project_id'],$this->param['template_id']);
194 //保存一条装修数据 197 //保存一条装修数据
195 if($rs === false){ 198 if($rs === false){