作者 zhl

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

... ... @@ -5,6 +5,7 @@ namespace App\Console\Commands\DayCount;
use App\Helper\Common;
use App\Helper\FormGlobalsoApi;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryForm;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
... ...
<?php
/**
* @remark :
* @name :UpgradeProjectCount.php
* @name :CountProject.php
* @author :lyh
* @method :post
* @time :2024/1/8 9:03
... ... @@ -9,6 +9,8 @@
namespace App\Console\Commands\DayCount;
use App\Helper\FormGlobalsoApi;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
use App\Services\ProjectServer;
... ... @@ -16,14 +18,16 @@ use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use App\Models\HomeCount\Count;
class UpgradeCount extends Command
class CountAll extends Command
{
const STATUS_ERROR = 400;
public $error = 0;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'upgrade_counts';
protected $signature = 'count_all';
/**
* The console command description.
... ... @@ -34,7 +38,7 @@ class UpgradeCount extends Command
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['is_upgrade'=>1,'delete_status'=>0]);
$list = $projectModel->list(['delete_status'=>0]);
foreach ($list as $v) {
echo date('Y-m-d H:i:s') . '项目id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
... ... @@ -90,6 +94,52 @@ class UpgradeCount extends Command
}
/**
* @param $arr
* @param $domain
* @name :(询盘统计)inquiry
* @author :lyh
* @method :post
* @time :2023/6/14 15:44
*/
public function inquiry($arr,$domain,$project_id){
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
if($inquiry_list == false){
return false;
}
if($inquiry_list['status'] == self::STATUS_ERROR){
$arr['inquiry_num'] = 0;
$countryArr = [];
}else{
$arr['inquiry_num'] = $inquiry_list['data']['total'];
//询盘国家统计
$countryData = $inquiry_list['data']['data'];
$countryArr = [];
foreach ($countryData as $v1){
if(isset($countryArr[$v1['country']])){
$countryArr[$v1['country']]++;
}else{
$countryArr[$v1['country']] = 1;
}
}
}
//加上其他询盘
ProjectServer::useProject($project_id);
$arr['inquiry_num'] += InquiryFormData::getCount();
$countryData = InquiryFormData::getCountryCount();
foreach ($countryData as $v1){
if(isset($countryArr[$v1['country']])){
$countryArr[$v1['country']] += $v1['count'];
}else{
$countryArr[$v1['country']] = $v1['count'];
}
}
arsort($countryArr);
$top20 = array_slice($countryArr, 0, 20, true);
$arr['country'] = json_encode($top20);
return $arr;
}
/**
* @remark :询盘数量
* @name :inquiry_num
* @author :lyh
... ...
<?php
/**
* @remark :
* @name :UpgradeProjectCount.php
* @name :CountProject.php
* @author :lyh
* @method :post
* @time :2024/1/8 9:03
... ... @@ -9,6 +9,10 @@
namespace App\Console\Commands\DayCount;
use App\Helper\FormGlobalsoApi;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\DeployOptimize;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
use App\Services\ProjectServer;
... ... @@ -16,14 +20,16 @@ use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use App\Models\HomeCount\Count;
class UpgradeProjectCount extends Command
class CountProject extends Command
{
const STATUS_ERROR = 400;
public $error = 0;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'upgrade_count {project_id}';
protected $signature = 'count_project {project_id}';
/**
* The console command description.
... ... @@ -51,6 +57,19 @@ class UpgradeProjectCount extends Command
->groupBy('updated_date')->get()->toArray();
$project = new Project();
$projectInfo = $project->read(['id'=>$project_id]);
$projectOptimizeModel = new DeployOptimize();
$optimizeInfo = $projectOptimizeModel->read(['project_id'=>$project_id]);
$domain = '';
if(!empty($optimizeInfo['domain'])){
$domainInfoModel = new DomainInfo();
$domainInfo = $domainInfoModel->read(['id'=>$optimizeInfo['domain']]);
if($domainInfo !== false){
$domain = $domainInfo['domain'];
}
}
if(empty($domain)){
return false;
}
if(!empty($list)){
$arr = [];
foreach ($list as $k=>$v){
... ... @@ -64,12 +83,11 @@ class UpgradeProjectCount extends Command
$arr['date'] = $v['updated_date'];
$arr['pv_num'] = $this->pv_num($v['updated_date']);
$arr['ip_num'] = $this->ip_num($v['updated_date']);
$arr['inquiry_num'] = $this->inquiry_num($v['updated_date']);
//服务达标天数
$arr['compliance_day'] = $projectInfo['finish_remain_day'];
//剩余服务时常
$arr['service_day'] = $projectInfo['remain_day'];
$arr['country'] = json_encode([]);
$arr = $this->inquiry($arr,$domain, $project_id);
//查询当天数据是否存在 存在则更新
$info = $count->read(['date'=>$v['updated_date'],'project_id'=>$project_id]);
if($info === false){
... ... @@ -103,7 +121,6 @@ class UpgradeProjectCount extends Command
* @time :2023/6/14 15:40
*/
public function pv_num($day){
//$pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $day)->count();
$pv = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $day)->sum('depth');
return $pv;
}
... ... @@ -119,6 +136,50 @@ class UpgradeProjectCount extends Command
return $ip;
}
/**
* @param $arr
* @param $domain
* @name :(询盘统计)inquiry
* @author :lyh
* @method :post
* @time :2023/6/14 15:44
*/
public function inquiry($arr,$domain,$project_id){
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
if($inquiry_list == false){
return false;
}
if($inquiry_list['status'] == self::STATUS_ERROR){
$arr['inquiry_num'] = 0;
$countryArr = [];
}else{
$arr['inquiry_num'] = $inquiry_list['data']['total'];
//询盘国家统计
$countryData = $inquiry_list['data']['data'];
$countryArr = [];
foreach ($countryData as $v1){
if(isset($countryArr[$v1['country']])){
$countryArr[$v1['country']]++;
}else{
$countryArr[$v1['country']] = 1;
}
}
}
//加上其他询盘
ProjectServer::useProject($project_id);
$arr['inquiry_num'] += InquiryFormData::getCount();
$countryData = InquiryFormData::getCountryCount();
foreach ($countryData as $v1){
if(isset($countryArr[$v1['country']])){
$countryArr[$v1['country']] += $v1['count'];
}else{
$countryArr[$v1['country']] = $v1['count'];
}
}
arsort($countryArr);
$top20 = array_slice($countryArr, 0, 20, true);
$arr['country'] = json_encode($top20);
return $arr;
}
}
... ...
... ... @@ -10,6 +10,7 @@
namespace App\Console\Commands\Domain;
use App\Models\Devops\ServerConfig;
use App\Models\Devops\ServersIp;
use App\Models\Project\CountryCustom;
use App\Models\Project\Project;
use Illuminate\Console\Command;
... ... @@ -98,13 +99,18 @@ class DomainInfo extends Command
$ssl['to'] && $data['certificate_end_time'] = $ssl['to'];
$project_info = $projectModel->read(['id' => $v['project_id']], ['serve_id']);
if ($v['type'] == 1 && $ssl['to'] < $end_day && $project_info && $project_info['serve_id'] != ServerConfig::SELF_SITE_ID) {
//非自建站项目,申请免费证书
$this->updatePrivate($v);
if ($v['type'] == 1 && $ssl['to'] < $end_day && $project_info) {
$serverIpModel = new ServersIp();
$servers_ip_info = $serverIpModel->read(['id' => $project_info['serve_id']], ['servers_id']);
if ($servers_ip_info && $servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) {
//非自建站项目,申请免费证书
$this->updatePrivate($v);
$ssl_new = $this->updateDomainSsl($v['domain']);
$ssl_new['from'] && $data['certificate_start_time'] = $ssl_new['from'];
$ssl_new['to'] && $data['certificate_end_time'] = $ssl_new['to'];
}
$ssl_new = $this->updateDomainSsl($v['domain']);
$ssl_new['from'] && $data['certificate_start_time'] = $ssl_new['from'];
$ssl_new['to'] && $data['certificate_end_time'] = $ssl_new['to'];
}
$domainModel->edit($data, ['id' => $v['id']]);
... ... @@ -142,13 +148,17 @@ class DomainInfo extends Command
$ssl['to'] && $data['amp_certificate_end_time'] = $ssl['to'];
$project_info = $projectModel->read(['id' => $v['project_id']], ['serve_id']);
if ($v['amp_type'] == 1 && $ssl['to'] < $end_day && $project_info && $project_info['serve_id'] != ServerConfig::SELF_SITE_ID) {
//非自建站项目,申请免费证书
$this->updateAmpPrivate($v['domain']);
if ($v['amp_type'] == 1 && $ssl['to'] < $end_day && $project_info) {
$serverIpModel = new ServersIp();
$servers_ip_info = $serverIpModel->read(['id' => $project_info['serve_id']], ['servers_id']);
if ($servers_ip_info && $servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) {
//非自建站项目,申请免费证书
$this->updateAmpPrivate($v['domain']);
$ssl_new = $this->updateDomainSsl($v['domain']);
$ssl_new['from'] && $data['certificate_start_time'] = $ssl_new['from'];
$ssl_new['to'] && $data['certificate_end_time'] = $ssl_new['to'];
$ssl_new = $this->updateDomainSsl($v['domain']);
$ssl_new['from'] && $data['certificate_start_time'] = $ssl_new['from'];
$ssl_new['to'] && $data['certificate_end_time'] = $ssl_new['to'];
}
}
$domainModel->edit($data, ['id' => $v['id']]);
... ...
<?php
/**
* @remark :
* @name :UpgradeProjectCount.php
* @name :CountProject.php
* @author :lyh
* @method :post
* @time :2024/1/8 9:03
... ... @@ -13,6 +13,7 @@ use App\Helper\FormGlobalsoApi;
use App\Models\Com\UpdateOldInfo;
use App\Models\Domain\DomainInfo;
use App\Models\HomeCount\MonthCount;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
use App\Services\ProjectServer;
... ... @@ -20,14 +21,14 @@ use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use App\Models\HomeCount\Count;
class UpgradeCount extends Command
class MonthAllCount extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'upgrade_month_counts';
protected $signature = 'month_all';
/**
* The console command description.
... ... @@ -38,14 +39,23 @@ class UpgradeCount extends Command
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['is_upgrade'=>1,'delete_status'=>0]);
$list = $projectModel->list(['delete_status'=>0]);
foreach ($list as $v) {
$oldModel = new UpdateOldInfo();
$info = $oldModel->read(['project_id' => $v['id']]);
if ($info !== false) {
$url = $info['old_domain_online'];
if($v['is_upgrade'] == 1){
$oldModel = new UpdateOldInfo();
$info = $oldModel->read(['project_id' => $v['id']]);
if ($info !== false) {
$url = $info['old_domain_online'];
}else{
continue;
}
}else{
continue;
$domainModel = new DomainInfo();
$info = $domainModel->read(['project_id'=>$v['id']]);
if($info === false){
continue;
}
$url = $info['domain'];
}
ProjectServer::useProject($v['id']);
echo date('Y-m-d H:i:s') . '项目id:'.$v['id'] . PHP_EOL;
... ... @@ -67,9 +77,7 @@ class UpgradeCount extends Command
->groupBy('month')->get()->toArray();
foreach ($list as $k=>$v){
$v = (array)$v;
if($v['month'] == date('Y-m')){
continue;
}
$arr = [];
$monthCountModel = new MonthCount();
$info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]);
// 获取当月开始时间
... ... @@ -78,7 +86,7 @@ class UpgradeCount extends Command
$end = date('Y-m-t', strtotime($v['month']));
$arr['project_id'] = $project_id;
$res = $this->inquiry($url,$v['month']);
// $arr['month_total'] = 0;
$arr['total'] = $arr['month_total'] = 0;
if(isset($res['data']['count'])){
echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
$arr['month_total'] = $res['data']['count'];
... ... @@ -91,9 +99,21 @@ class UpgradeCount extends Command
$arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0);
}
}
//获取当月的其他询盘
$arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']);
$country = [];
if(isset($res['data']['data'])){
$arr['country'] = json_encode($res['data']['data']);
$country = $res['data']['data'];
}
$countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']);
foreach ($countryData as $v1){
if(isset($country[$v1['country']])){
$country[$v1['country']] += $v1['count'];
}else{
$country[$v1['country']] = $v1['count'];
}
}
$arr['country'] = json_encode($country);
$arr['month'] = $v['month'];
$arr = $this->pv_ip($arr,$start,$end,$project_id);
$arr = $this->sourceCount($arr,$start,$end);
... ...
<?php
/**
* @remark :
* @name :UpgradeProjectCount.php
* @name :CountProject.php
* @author :lyh
* @method :post
* @time :2024/1/8 9:03
... ... @@ -11,6 +11,7 @@ namespace App\Console\Commands\MonthlyCount;
use App\Models\Com\UpdateOldInfo;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
... ... @@ -98,44 +99,57 @@ class MonthCount extends Command
* @time :2024/1/8 9:05
*/
public function count($project_id,$url){
$v = ['month'=>date('Y-m')];
$monthCountModel = new MonthCountModel();
$info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]);
// 获取当月开始时间
$start = date('Y-m-01', strtotime($v['month']));
// 获取当月结束时间
$end = date('Y-m-t', strtotime($v['month']));
$arr['project_id'] = $project_id;
$res = $this->inquiry($url,$v['month']);
// $arr['month_total'] = 0;
if(isset($res['data']['count'])){
echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
$arr['month_total'] = $res['data']['count'];
//获取上一个的count
$previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month'));
$previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]);
if($previousInfo === false){
$arr['total'] = $arr['month_total'];
}else{
$arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0);
}
}
if(isset($res['data']['data'])){
$arr['country'] = json_encode($res['data']['data']);
$arr = [];
$v = ['month'=>date('Y-m')];
$monthCountModel = new MonthCountModel();
$info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]);
// 获取当月开始时间
$start = date('Y-m-01', strtotime($v['month']));
// 获取当月结束时间
$end = date('Y-m-t', strtotime($v['month']));
$arr['project_id'] = $project_id;
$res = $this->inquiry($url,$v['month']);
$arr['total'] = $arr['month_total'] = 0;
if(isset($res['data']['count'])){
echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
$arr['month_total'] = $res['data']['count'];
//获取上一个的count
$previousMonth = date('Y-m', strtotime($v['month'] . ' -1 month'));
$previousInfo = $monthCountModel->read(['month'=>$previousMonth,'project_id'=>$project_id]);
if($previousInfo === false){
$arr['total'] = $arr['month_total'];
}else{
$arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0);
}
$arr['month'] = $v['month'];
$arr = $this->pv_ip($arr,$start,$end,$project_id);
$arr = $this->sourceCount($arr,$start,$end);
if($info === false){
$selectedDate = $start;
$firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month"));
$arr['created_at'] = $firstDayOfNextMonth;
$arr['updated_at'] = $firstDayOfNextMonth;
// echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL;
$monthCountModel->insert($arr);
}
//获取当月的其他询盘
$arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']);
$country = [];
if(isset($res['data']['data'])){
$country = $res['data']['data'];
}
$countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']);
foreach ($countryData as $v1){
if(isset($country[$v1['country']])){
$country[$v1['country']] += $v1['count'];
}else{
$monthCountModel->edit($arr,['id'=>$info['id']]);
$country[$v1['country']] = $v1['count'];
}
}
$arr['country'] = json_encode($country);
$arr['month'] = $v['month'];
$arr = $this->pv_ip($arr,$start,$end,$project_id);
$arr = $this->sourceCount($arr,$start,$end);
if($info === false){
$selectedDate = $start;
$firstDayOfNextMonth = date('Y-m-01 01:00:00', strtotime("$selectedDate +1 month"));
$arr['created_at'] = $firstDayOfNextMonth;
$arr['updated_at'] = $firstDayOfNextMonth;
// echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL;
$monthCountModel->insert($arr);
}else{
$monthCountModel->edit($arr,['id'=>$info['id']]);
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ...
<?php
/**
* @remark :
* @name :UpgradeProjectCount.php
* @name :CountProject.php
* @author :lyh
* @method :post
* @time :2024/1/8 9:03
... ... @@ -13,6 +13,7 @@ use App\Helper\FormGlobalsoApi;
use App\Models\Com\UpdateOldInfo;
use App\Models\Domain\DomainInfo;
use App\Models\HomeCount\MonthCount;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
use App\Services\ProjectServer;
... ... @@ -20,14 +21,14 @@ use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use App\Models\HomeCount\Count;
class UpgradeProjectCount extends Command
class MonthProjectCount extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'upgrade_month_count {project_id}';
protected $signature = 'month_project {project_id}';
/**
* The console command description.
... ... @@ -64,10 +65,8 @@ class UpgradeProjectCount extends Command
->select(DB::raw('DATE_FORMAT(updated_date, "%Y-%m") as month'))
->groupBy('month')->get()->toArray();
foreach ($list as $k=>$v){
$arr = [];
$v = (array)$v;
if($v['month'] == date('Y-m')){
continue;
}
$monthCountModel = new MonthCount();
$info = $monthCountModel->read(['month'=>$v['month'],'project_id'=>$project_id]);
// 获取当月开始时间
... ... @@ -76,7 +75,7 @@ class UpgradeProjectCount extends Command
$end = date('Y-m-t', strtotime($v['month']));
$arr['project_id'] = $project_id;
$res = $this->inquiry($url,$v['month']);
// $arr['month_total'] = 0;
$arr['total'] = $arr['month_total'] = 0;
if(isset($res['data']['count'])){
echo date('Y-m-d H:i:s') . '数据:'.$res['data']['count'] . PHP_EOL;
$arr['month_total'] = $res['data']['count'];
... ... @@ -89,9 +88,21 @@ class UpgradeProjectCount extends Command
$arr['total'] = $res['data']['count'] + ($previousInfo['total'] ?? 0);
}
}
//获取当月的其他询盘
$arr['total'] += InquiryFormData::getCount([$start.' 00:00:00',$end.' 00:00:00']);
$country = [];
if(isset($res['data']['data'])){
$arr['country'] = json_encode($res['data']['data']);
$country = $res['data']['data'];
}
$countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']);
foreach ($countryData as $v1){
if(isset($country[$v1['country']])){
$country[$v1['country']] += $v1['count'];
}else{
$country[$v1['country']] = $v1['count'];
}
}
$arr['country'] = json_encode($country);
$arr['month'] = $v['month'];
$arr = $this->pv_ip($arr,$start,$end,$project_id);
$arr = $this->sourceCount($arr,$start,$end);
... ...
... ... @@ -13,6 +13,7 @@ use App\Models\Com\KeywordVideoTaskLog;
use App\Models\Domain\DomainInfo;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
/**
* @remark :通知C端生成界面
... ... @@ -65,6 +66,7 @@ class Notice extends Command
}
foreach ($domainList as $v1){
//TODO::通知C端
@file_put_contents(storage_path('logs/notice_c_'.date('Y-m-d').'.log'), var_export($v1['domain'], true) . PHP_EOL, FILE_APPEND);
$this->curlDelRoute($v1['domain'],$v1['project_id']);
}
return true;
... ...
... ... @@ -51,19 +51,12 @@ class RecommendedSuppliers extends Command
{
$projectModel = new DeployBuild();
$project_list = $projectModel->list(['is_supplier'=>1]);//TODO::已开启推荐供应商
foreach ($project_list as $k => $v){
foreach ($project_list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['project_id'] . PHP_EOL;
ProjectServer::useProject($v['project_id']);
$info = Keyword::inRandomOrder()->first();
if(empty($info)){
continue;
}
$keywordInfo = $this->getPurchaser($info->title,$v['project_id']);
if($keywordInfo !== false){
continue;
}
$title = $this->getKeywords($v['project_id']);
echo date('Y-m-d H:i:s') . '开始:'.$v['project_id'] . PHP_EOL;
$this->savePurchaser($v['project_id'],$info->title);
$this->savePurchaser($v['project_id'],$title);
DB::disconnect('custom_mysql');
}
return true;
... ... @@ -122,6 +115,8 @@ class RecommendedSuppliers extends Command
* @time :2024/7/1 18:07
*/
public function getKeywords($project_id){
$keywordModel = new Keyword();
$keywordModel->
$info = Keyword::inRandomOrder()->first();
$keywordInfo = $this->getPurchaser($info->title,$project_id);
if($keywordInfo !== false){
... ...
... ... @@ -28,23 +28,15 @@ class SyncSubmitTask extends Command
public function handle()
{
$backup = false;
while (true) {
$task_id = $this->getTaskId();
if ($task_id > 2000000) {
$backup = true;
}
if (empty($task_id)) {
if ($backup) {
$this->backup();
$backup = false;
}
sleep(5);
$task_id = Redis::rpop('sync_submit_task');
if(!$task_id){
sleep(3);
continue;
}
$this->output('任务' . $task_id . '开始');
$task_info = SyncSubmitTaskModel::find($task_id);
if (empty($task_info) || $task_info->status) {
if (empty($task_info) || $task_info->status !=3) {
$this->output('任务不存在或者已执行');
continue;
}
... ... @@ -79,29 +71,6 @@ class SyncSubmitTask extends Command
}
}
public function getTaskId()
{
$task_id = Redis::rpop('sync_submit_task');
$lockKey = 'lock_sync_submit_task';
if (empty($task_id)) {
// 获取锁
if (Redis::setnx($lockKey, 1)) {
// 设置锁的过期时间,防止死锁
Redis::expire($lockKey, 10);
$ids = SyncSubmitTaskModel::where('status', 0)->limit(100)->pluck('id');
foreach ($ids as $id) {
Redis::lpush('sync_submit_task', $id);
}
$task_id = Redis::rpop('sync_submit_task');
Redis::del($lockKey);
} else {
// 未获取到锁
return '';
}
}
return $task_id;
}
/**
* 输出处理日志
*/
... ... @@ -110,31 +79,4 @@ class SyncSubmitTask extends Command
echo date('Y-m-d H:i:s') . ' | ' . $message . PHP_EOL;
return true;
}
/**
* 备份数据
* @author zbj
* @date 2024/1/23
*/
public function backup()
{
DB::beginTransaction();
try {
$table = (new SyncSubmitTaskModel())->getTable();
$new_table = $table . '_backup_' . date('Ymd');
//重命名当前表
Schema::rename($table, $new_table);
//克隆表数据
DB::statement('CREATE TABLE ' . $table . ' LIKE ' . $new_table);
DB::commit();
$this->output('数据备份成功');
} catch (\Exception $e) {
$this->output('数据备份失败' . $e->getMessage());
DB::rollBack();
}
return true;
}
}
... ...
<?php
namespace App\Console\Commands\Sync;
use App\Exceptions\InquiryFilterException;
use App\Models\Project\Project;
use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel;
use App\Services\SyncSubmitTaskService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
/**
*
* Class SyncSubmitTask
* @package App\Console\Commands
* @author zbj
* @date 2023/11/28
*/
class SyncSubmitTaskDistribution extends Command
{
protected $signature = 'sync_submit_task_distribution';
protected $description = '询盘、访问异步任务分发';
public function handle()
{
while (true) {
$len = Redis::llen('sync_submit_task');
if (!$len) {
$max_id = SyncSubmitTaskModel::orderBy('id', 'desc')->value('id');
if ($max_id > 2000000) {
$this->backup();
} else {
$tasks = SyncSubmitTaskModel::where('status', 0)->limit(100)->get();
foreach ($tasks as $task) {
$task->status = 3;
$task->save();
Redis::lpush('sync_submit_task', $task->id);
}
}
}
sleep(3);
}
}
/**
* 输出处理日志
*/
public function output($message): bool
{
echo date('Y-m-d H:i:s') . ' | ' . $message . PHP_EOL;
return true;
}
/**
* 备份数据
* @author zbj
* @date 2024/1/23
*/
public function backup()
{
DB::beginTransaction();
try {
$table = (new SyncSubmitTaskModel())->getTable();
$new_table = $table . '_backup_' . date('Ymd');
//重命名当前表
Schema::rename($table, $new_table);
//克隆表数据
DB::statement('CREATE TABLE ' . $table . ' LIKE ' . $new_table);
//未入队的写到新表
$list = DB::table($new_table)->where('status', 0)->get();
$data = [];
foreach ($list as $task) {
$data[] = [
'type' => $task->type,
'data' => json_encode($task->data),
'created_at' => $task['created_at'],
'updated_at' => $task['updated_at'],
];
}
$data && SyncSubmitTaskModel::insert($data);
DB::commit();
$this->output('数据备份成功');
} catch (\Exception $e) {
$this->output('数据备份失败' . $e->getMessage());
DB::rollBack();
}
return $new_table ?? '';
}
}
... ...
... ... @@ -54,12 +54,13 @@ class UpdateRoute extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['id'=>['in',[1085]]]);
$list = $projectModel->list(['id'=>['in',[664]]]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->getProduct();
// $this->setProductKeyword();
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
... ... @@ -106,19 +107,8 @@ class UpdateRoute extends Command
if(!empty($lists)){
foreach ($lists as $v){
if(!empty($v['route'])){
// $tag = "-tag";
// if ((substr($v['route'], -strlen($tag)) === $tag)) {
// echo date('Y-m-d H:i:s') . '拼接 :'.$v['id'] . PHP_EOL;
// $route = Translate::tran($v['route'], 'en').$tag;
// // 如果不是以 '-tag' 结尾,则拼接上 '-tag'
// $route = trim($v['route'],'-tag');
// $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']);
// $keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
// }else{
// $route = Translate::tran($v['title'], 'en').$tag;
// $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']);
// $keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
// }
echo date('Y-m-d H:i:s') . 'route :'.$v['id'] . PHP_EOL;
continue;
}else{
echo date('Y-m-d H:i:s') . 'route :'.$v['id'] . PHP_EOL;
$route = Translate::tran($v['title'], 'en');
... ... @@ -128,7 +118,6 @@ class UpdateRoute extends Command
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
}
}
echo date('Y-m-d H:i:s') . 'end :' . PHP_EOL;
}
}
}
... ... @@ -224,7 +213,7 @@ class UpdateRoute extends Command
public function getProduct(){
$productModel = new Product();
$lists = $productModel->list(['status'=>1]);
$lists = $productModel->list(['status'=>1,'id'=>['<=',501]]);
if(!empty($lists)){
foreach ($lists as $v){
if(!empty($v['route'])){
... ... @@ -240,9 +229,10 @@ class UpdateRoute extends Command
// $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT, $v['id'], $v['project_id']);
// $productModel->edit(['route'=>$route],['id'=>$v['id']]);
}
continue;
}else{
echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL;
// $v['title'] = Translate::tran($v['title'], 'en');
$v['title'] = Translate::tran($v['title'], 'en');
$route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT, $v['id'], $v['project_id']);
$productModel->edit(['route'=>$route],['id'=>$v['id']]);
}
... ...
<?php
/**
* @remark :
* @name :UpdateKeyword.php
* @author :lyh
* @method :post
* @time :2024/7/3 9:23
*/
namespace App\Console\Commands\Update;
use App\Models\Domain\DomainInfo;
use App\Models\Product\Keyword;
use App\Models\Product\KeywordPage;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class UpdateKeyword extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update_keyword_content';
/**
* The console command description.
*
* @var string
*/
protected $description = '批量更新关键词内容';
public function handle(){
while (true){
$keywordPageModel = new KeywordPage();
$lists = $keywordPageModel->list(['status'=>0]);
if(empty($lists)){
sleep(100);
continue;
}
$domainModel = new DomainInfo();
foreach ($lists as $v){
ProjectServer::useProject($v['project_id']);
$this->saveKeywordContent($v);
DB::disconnect('custom_mysql');
//获取当前项目的域名
$domainInfo = $domainModel->read(['project_id'=>$v['project_id']]);
if($domainInfo !== false){
$this->curlDelRoute($domainInfo['domain'],$v['project_id']);
}
$keywordPageModel->edit(['status'=>1],['id'=>$v['id']]);
}
sleep(10);
}
}
/**
* @remark :更新关键词内容
* @name :saveKeywordContent
* @author :lyh
* @method :post
* @time :2024/7/3 10:25
*/
public function saveKeywordContent($info){
$keywordModel = new Keyword();
$updateObject = json_decode($info['update_object'],true);
$text = json_decode($info['text'],true);
if(empty($text)){
return false;
}
$number = count($text);
$randomNumber = rand(0, $number - 1);
if($updateObject['type'] == 0){//更新所有关键字
$keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['status'=>1]);
}else{
//按传递的关键字更新
if(!empty($updateObject['keyword'])){
$updateObject['keyword'] = (array)$updateObject['keyword'];
$keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['title'=>['in',$updateObject['keyword']]]);
}
//按给定的数量更新
if(!empty($updateObject['number']) && ($updateObject['number'] != 0)){
$keywordIdArr = $keywordModel->where("status",1)->inRandomOrder()->take($updateObject['number'])->pluck('id')->toArray();
$keywordModel->edit(['keyword_content'=>$text[$randomNumber]],['id'=>['in',$keywordIdArr]]);
}
}
return true;
}
/**
* @remark :删除路由通知C端
* @name :curlDelRoute
* @author :lyh
* @method :post
* @time :2023/11/30 14:43
*/
public function curlDelRoute($domain,$project_id){
if (strpos($domain, 'https://') === false) {
$domain = 'https://' . $domain . '/';
}
$url = $domain.'api/update_page/?project_id='.$project_id.'&route=4';
shell_exec('curl -k "'.$url.'"');
return true;
}
}
... ...
... ... @@ -48,6 +48,8 @@ class Kernel extends ConsoleKernel
$schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次
$schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字
$schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
$schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1);
// 每日推送视频任务
$schedule->command('video_task')->hourly()->withoutOverlapping(1);
// 每日推送已完成视频任务项目生成对应界面
... ...
... ... @@ -42,7 +42,7 @@ class AutoTaskController extends BaseController
$where['status'] = $status - 1;
$result = Notify::select(['id','project_id', 'type', 'data', 'status', 'route', 'num', 'updated_at', 'created_at'])
->where('id', '>', 84000) // 查询有效数据
->where('server_id', '<>', 9) // 过滤测试环境数据
->where('server_id', '<>', 7) // 过滤测试环境数据
->where('server_id', '>', 0) // 过滤测试环境数据
->where($where)
->orderBy('id', 'desc')
... ... @@ -99,4 +99,4 @@ class AutoTaskController extends BaseController
];
return $this->response('success', Code::SUCCESS, $result);
}
}
\ No newline at end of file
}
... ...
... ... @@ -16,6 +16,7 @@ use App\Models\Com\Notify;
use App\Models\Com\UpdateNotify;
use App\Models\Com\UpdateProgress;
use App\Models\Devops\ServerConfig;
use App\Models\Devops\ServersIp;
use App\Models\Domain\DomainInfo;
use App\Models\Project\Country as CountryModel;
use App\Models\Project\Project;
... ... @@ -51,8 +52,14 @@ class CNoticeController extends BaseController
//获取项目所在服务器
$project_model = new Project();
$project_info = $project_model->read(['id'=>$project_id],['serve_id']);
if(!$project_info){
$this->fail('未查询到项目数据');
}
$serve_ip_model = new ServersIp();
$serve_ip_info = $serve_ip_model->read(['id'=>$project_info['serve_id']],['servers_id']);
$servers_id = $serve_ip_info ? $serve_ip_info['servers_id'] : 0;
if($project_info && $project_info['serve_id'] == ServerConfig::SELF_SITE_ID){
if($servers_id == ServerConfig::SELF_SITE_ID){
//自建站服务器:如果项目已经上线,不请求C端接口,数据直接入库
$domain_model = new DomainInfo();
$domain_info = $domain_model->read(['project_id'=>$this->user['project_id']],['domain']);
... ...
... ... @@ -312,13 +312,13 @@ class ComController extends BaseController
public function getMobileProject(){
$data = [];
$userModel = new User();
$list = $userModel->list(['mobile'=>$this->user['mobile'],'project_id'=>['!=',$this->user['project_id']]],'id',['id','project_id']);
if(!empty($list)){
$project_id = $userModel->formatQuery(['mobile'=>$this->user['mobile'],'project_id'=>['!=',$this->user['project_id']]])->pluck('project_id')->toArray();
if(!empty($project_id)){
$projectModel = new Project();
foreach ($list as $k => $v){
$projectInfo = $projectModel->read(['id'=>$v['project_id']],['id','company']);
$list = $projectModel->list(['id'=>['in',$project_id],'delete_status'=>0],'id',['id','company']);
foreach ($list as $v){
//获取当前项目详情
$data[] = ['project_id'=>$projectInfo['id'],'company'=>$projectInfo['company']];
$data[] = ['project_id'=>$v['id'],'company'=>$v['company']];
}
}
//登录选择项目的有效时间
... ...
... ... @@ -7,7 +7,9 @@ use App\Helper\Arr;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Product\KeywordLogic;
use App\Http\Requests\Bside\Product\KeywordRequest;
use App\Models\Com\NoticeLog;
use App\Models\Product\Keyword;
use App\Models\Product\KeywordPage;
use App\Models\Product\KeywordRelated;
use App\Models\Product\Product;
use App\Models\RouteMap\RouteMap;
... ... @@ -232,4 +234,30 @@ class KeywordController extends BaseController
}
$this->response('success');
}
/**
* @remark :批量提交更新关键词
* @name :batchUpdateKeyword
* @author :lyh
* @method :post
* @time :2024/7/2 10:14
*/
public function batchUpdateKeyword(){
$this->request->validate([
'text'=>'required|array',
'update_object'=>'required|array',
'update_method'=>'required'
],[
'text.required' => '文件内容不能为空',
'update_object.required' => '更新对象不为空',
'update_object.array' => '更新对象为数组',
'update_method.required' => '请求方式不为空'
]);
$keywordPageModel = new KeywordPage();
$this->param['text'] = json_encode($this->param['text']);
$this->param['update_object'] = json_encode($this->param['update_object']);
$this->param['project_id'] = $this->user['project_id'];
$id = $keywordPageModel->addReturnId($this->param);
$this->response('success',Code::SUCCESS,['id'=>$id]);
}
}
... ...
... ... @@ -268,10 +268,10 @@ class DomainInfoLogic extends BaseLogic
$serverModel = new Servers();
$serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
$server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
if($project_info['serve_id'] == 9){
if($serversIpInfo['servers_id'] == 7){
$this->fail('请切换服务器,生成站点不能使用测试服务器');
}
if($project_info['serve_id'] == ServerConfig::SELF_SITE_ID){
if($serversIpInfo['servers_id'] == ServerConfig::SELF_SITE_ID){
$this->model->edit(['amp_status' => $this->param['amp_status'] ?? 0,],['id'=>$this->param['id']]);
$this->fail('自建站服务器无法生成站点');
}
... ... @@ -303,8 +303,8 @@ class DomainInfoLogic extends BaseLogic
//保存301跳转数据+其他域名
$data = [
'other_domain'=>json_encode($this->param['other_domain'] ?? []),
'extend_config'=>json_encode($this->param['extend_config'] ?? []),
'other_domain'=>json_encode(array_filter($this->param['other_domain'] ?? [])),
'extend_config'=>json_encode(array_filter($this->param['extend_config'] ?? [])),
'type'=>$this->param['type'],
'private_key' => $this->param['key'] ?? '',
'private_cert' => $this->param['cert'] ?? '',
... ... @@ -313,8 +313,8 @@ class DomainInfoLogic extends BaseLogic
'amp_type' => $this->param['amp_type'] ?? 0,
'amp_private_key' => $this->param['amp_key'] ?? '',
'amp_private_cert' => $this->param['amp_cert'] ?? '',
'not_allow_country'=>json_encode($this->param['not_allow_country'] ?? []),
'not_allow_ip'=>json_encode($this->param['not_allow_ip'] ?? []),
'not_allow_country'=>json_encode(array_filter($this->param['not_allow_country'] ?? [])),
'not_allow_ip'=>json_encode(array_filter($this->param['not_allow_ip'] ?? [])),
];
$this->model->edit($data,['id'=>$this->param['id']]);
//主站生成证书
... ... @@ -391,6 +391,12 @@ class DomainInfoLogic extends BaseLogic
$serverModel = new Servers();
$serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
$server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
if($serversIpInfo['servers_id'] == 7){
$this->fail('请切换服务器,生成站点不能使用测试服务器');
}
if($serversIpInfo['servers_id'] == ServerConfig::SELF_SITE_ID){
$this->fail('自建站服务器无法生成站点');
}
//域名是否都已经解析
if(strpos($this->param['custom_domain'],'//') === false){
$this->param['custom_domain'] = '//'.$this->param['custom_domain'];
... ...
... ... @@ -148,7 +148,7 @@ class ProjectLogic extends BaseLogic
//初始化项目
$this->createProjectData($this->param);
//双向绑定服务器,需放到保存项目的上方
$this->setServers($this->param['serve_id'],$this->param['id']);
$this->setServers($this->param['serve_id'] ?? 0,$this->param['id']);
//保存项目信息
$this->saveProject($this->param);
//保存建站部署信息
... ... @@ -192,6 +192,9 @@ class ProjectLogic extends BaseLogic
$serversModel->where(['id'=>$oldServerIpInfo['servers_id']])->decrement('being_number',1);
}
}
if(empty($servers_id)){
return $this->success();
}
$serversIpInfo = $serversIpModel->read(['id'=>$servers_id]);
$serversInfo = $serversModel->read(['id'=>$serversIpInfo['servers_id']]);
if($serversIpInfo['total'] >= $serversInfo['ip_total']){
... ...
... ... @@ -124,11 +124,11 @@ class ATemplateLogic extends BaseLogic
if(!empty($info['image'])){
$info['image_link'] = getImageUrl($info['image']);
}
if(!empty($info['design_manager'])){
$info['design_manager'] = (new Manage())->getName($info['design_manager']);
if(!empty($info['design_msg'])){
$info['design_msg'] = json_decode($info['design_msg']);
}
if(!empty($info['front_manager'])){
$info['front_manager'] = (new Manage())->getName($info['front_manager']);
if(!empty($info['front_msg'])){
$info['front_msg'] = json_decode($info['front_msg']);
}
return $this->success($info);
}
... ... @@ -261,15 +261,11 @@ class ATemplateLogic extends BaseLogic
*/
public function auditingStatus(){
//获取当前数据详情
$info = $this->model->read(['id'=>$this->param['id']]);
if(isset($this->param['front_status']) && $this->param['front_status'] == 1){
if($info['design_status'] == 0){
$this->fail('请先提交设计审核');
}
$this->param['design_manager'] = $this->manager['id'];
$this->param['test_model'] = 0;
}else{
$this->param['front_manager'] = $this->manager['id'];
if(isset($this->param['design_msg']) && !empty($this->param['design_msg'])){
$this->param['design_msg'] = json_encode($this->param['design_msg']);
}
if(isset($this->param['front_msg']) && !empty($this->param['front_msg'])){
$this->param['front_msg'] = json_encode($this->param['front_msg']);
}
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
... ...
... ... @@ -8,6 +8,7 @@ use App\Exceptions\BsideGlobalException;
use App\Http\Logic\Logic;
use App\Models\Com\UpdateNotify;
use App\Models\Devops\ServerConfig;
use App\Models\Devops\ServersIp;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteDelete;
use App\Models\Service\Service;
... ... @@ -175,11 +176,13 @@ class BaseLogic extends Logic
$data['project_id'] = $this->user['project_id'];
$str = http_build_query($data);
$url = $this->user['domain'].'api/delHtml/?'.$str;
if(isset($this->project['serve_id']) && ($this->project['serve_id'] == ServerConfig::SELF_SITE_ID)){
$serverIpModel = new ServersIp();
$serversIpInfo = $serverIpModel->read(['id'=>$this->project['serve_id']],['servers_id']);
if($serversIpInfo && ($serversIpInfo['servers_id'] == ServerConfig::SELF_SITE_ID)){
//自建站服务器直接返回
return $this->success();
}
if(isset($this->project['serve_id']) && ($this->project['serve_id'] != 1)){//TODO::当前项目通知不过 ,跳过自动更新
if($serversIpInfo && ($serversIpInfo['servers_id'] != 1)){//TODO::当前项目通知不过 ,跳过自动更新
exec('curl -k "'.$url.'" > /dev/null 2>&1 &');
}else{
shell_exec('curl -k "'.$url.'"');
... ...
... ... @@ -34,7 +34,7 @@ class ServerConfig extends Base
const STATUS_ONE = 1;
const SELF_SITE_ID = 8;//自建站服务器ID
const SELF_SITE_ID = 6;//自建站服务器ID
/**
* @remark :获取数据用户名解密
... ...
... ... @@ -15,7 +15,6 @@ use App\Utils\EncryptUtils;
class Servers extends Base
{
protected $table = 'gl_servers';
const SELF_SITE_ID = 8;//自建站服务器ID
/**
* @remark :获取数据用户名解密
... ...
<?php
/**
* @remark :
* @name :KeywordPage.php
* @author :lyh
* @method :post
* @time :2024/7/2 15:26
*/
namespace App\Models\Product;
use App\Models\Base;
class KeywordPage extends Base
{
protected $table = 'gl_product_keyword_page';
}
... ...
... ... @@ -133,6 +133,9 @@ class SyncSubmitTaskService
$visit_data['updated_date'] = $data['submit_at']->toDateString();
$visit_data['created_at'] = $data['submit_at'];
$visit_data['user_agent'] = $data['user_agent'];
if(!empty($data['is_cf'])){
$visit_data['is_inquiry'] = 1;
}
Visit::saveData($visit_data, $date);
return true;
... ...
... ... @@ -271,6 +271,7 @@ Route::middleware(['bloginauth'])->group(function () {
Route::post('keyword/batchAdd', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchAdd'])->name('product_keyword_batchAdd');
Route::post('keyword/batchDel', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchDel'])->name('product_keyword_batchDel');
Route::any('keyword/delete', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delete'])->name('product_keyword_delete');
Route::any('keyword/batchUpdateKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchUpdateKeyword'])->name('product_keyword_batchUpdateKeyword');
Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo');
Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled');
//产品参数
... ...