作者 lyh

gx数据

... ... @@ -65,9 +65,9 @@ class Count extends Command
$arr['date'] = $yesterday;
ProjectServer::useProject($v['id']);
//pv统计
$arr['pv_num'] = $this->pv_num($yesterday,$v['test_domain']);
$arr['pv_num'] = $this->pv_num($yesterday);
//ip统计
$arr['ip_num'] = $this->ip_num($yesterday,$v['test_domain']);
$arr['ip_num'] = $this->ip_num($yesterday);
DB::disconnect('custom_mysql');
//服务达标天数
$arr['compliance_day'] = $v['finish_remain_day'];
... ...
... ... @@ -66,9 +66,9 @@ class CountDate extends Command
$arr['date'] = $yesterday;
ProjectServer::useProject($v['id']);
//pv统计
$arr['pv_num'] = $this->pv_num($yesterday,$v['test_domain']);
$arr['pv_num'] = $this->pv_num($yesterday);
//ip统计
$arr['ip_num'] = $this->ip_num($yesterday,$v['test_domain']);
$arr['ip_num'] = $this->ip_num($yesterday);
DB::disconnect('custom_mysql');
//服务达标天数
$arr['compliance_day'] = $v['finish_remain_day'];
... ...
... ... @@ -39,7 +39,7 @@ class TemplateLabel extends Command
*/
public function handle(){
//获取最近7天模版的记录
$start_time = now()->subDays(90)->startOfDay()->toDateString();
$start_time = now()->subDays(7)->startOfDay()->toDateString();
$end_time = now()->startOfDay()->toDateString();
$this->setTemplateModule($start_time,$end_time);
$this->setTemplate($start_time,$end_time);
... ...
... ... @@ -38,6 +38,8 @@ use App\Models\Purchaser\PurchaserInfo;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BCustomTemplate;
use App\Models\Template\BTemplateCom;
use App\Models\Template\Setting;
use App\Models\Template\Template;
use App\Services\AmazonS3Service;
use App\Services\ProjectServer;
use App\Utils\EncryptUtils;
... ... @@ -65,15 +67,33 @@ class Demo extends Command
public function handle(){
echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL;
ProjectServer::useProject(2837);
$this->ceshi();
DB::disconnect('custom_mysql');
// echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL;
// ProjectServer::useProject(2837);
// $this->ceshi();
// DB::disconnect('custom_mysql');
$this->countTemplate();
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
/**
* @remark :统计当前模版使用情况
* @name :countTemplate
* @author :lyh
* @method :post
* @time :2025/1/9 10:59
*/
public function countTemplate(){
$bSettingModel = new Setting();
$lists = $bSettingModel->list();
$templateModel = new Template();
foreach ($lists as $v){
echo date('Y-m-d H:i:s') . '执行的模版id:' .$v['template_id'] . PHP_EOL;
$templateModel->where(['id'=>$v['template_id']])->increment('total',1);
}
return true;
}
/**
* @remark :更新产品
* @name :getProduct
* @author :lyh
... ...
... ... @@ -187,9 +187,12 @@ class ATemplateLogic extends BaseLogic
'template_id'=>$this->param['template_id'],
];
$rs = $bSettingModel->add($param);
}else{
$this->model->where(['id'=>$info['template_id']])->decrement('number',1);
$rs = $bSettingModel->edit(['template_id'=>$this->param['template_id']],['id'=>$info['id']]);
}
$this->model->where(['id'=>$this->param['template_id']])->increment('number',1);
$this->saveTemplate($this->param['project_id'],$this->param['template_id']);
//保存一条装修数据
if($rs === false){
... ...