作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

@@ -11,7 +11,6 @@ namespace App\Console\Commands\Domain; @@ -11,7 +11,6 @@ namespace App\Console\Commands\Domain;
11 11
12 use Illuminate\Console\Command; 12 use Illuminate\Console\Command;
13 use App\Models\Domain\DomainInfo as DomainInfoModel; 13 use App\Models\Domain\DomainInfo as DomainInfoModel;
14 -use Illuminate\Support\Facades\Log;  
15 14
16 class DomainInfo extends Command 15 class DomainInfo extends Command
17 { 16 {
@@ -36,37 +35,106 @@ class DomainInfo extends Command @@ -36,37 +35,106 @@ class DomainInfo extends Command
36 * @method :post 35 * @method :post
37 * @time :2023/9/11 15:09 36 * @time :2023/9/11 15:09
38 */ 37 */
39 - public function handle(){ 38 + public function handle()
  39 + {
  40 + //更新域名到期时间
  41 + $this->startUpdateDomain();
  42 +
  43 + //主站证书到期更新
  44 + $this->startUpdateCert();
  45 +
  46 + //AMP站证书到期更新
  47 + $this->startUpdateAmpCert();
  48 +
  49 + return true;
  50 + }
  51 +
  52 + /**
  53 + * 更新域名到期时间
  54 + * @author Akun
  55 + * @date 2024/02/26 10:26
  56 + */
  57 + public function startUpdateDomain()
  58 + {
  59 + $domainModel = new DomainInfoModel();
  60 + $list = $domainModel->where('status', '!=', 2)->where(function ($query) {
  61 + $query->whereNull('domain_end_time')->orWhere('domain_end_time', '<', date('Y-m-d H:i:s'));
  62 + })->get()->toArray();
  63 + foreach ($list as $v) {
  64 + $time = $this->updateDomain($v['domain']);
  65 + $data = [
  66 + 'domain_start_time' => $time['start'],
  67 + 'domain_end_time' => $time['end']
  68 + ];
  69 +
  70 + $domainModel->edit($data, ['id' => $v['id']]);
  71 + }
  72 + }
  73 +
  74 + /**
  75 + * 主站证书到期更新
  76 + * @author Akun
  77 + * @date 2024/02/26 10:26
  78 + */
  79 + public function startUpdateCert()
  80 + {
40 $domainModel = new DomainInfoModel(); 81 $domainModel = new DomainInfoModel();
41 - $map = ['status'=>['!=',2]];  
42 - $list = $domainModel->list($map);  
43 - foreach ($list as $v){  
44 - if(empty($v['private_key']) || empty($v['private_cert'])){  
45 - //域名结束时间<2天时,重新生成  
46 - if(!empty($v['certificate_end_time'])){  
47 - if(($v['certificate_end_time'] > date('Y-m-d H:i:s',time() + 24*3600)) || ($v['certificate_end_time'] < date('Y-m-d H:i:s',time()))){ 82 + $end_day = date('Y-m-d H:i:s', time() + 2 * 24 * 3600);//2天后到期
  83 + $list = $domainModel->where('status', '!=', 2)->where(function ($query) use ($end_day) {
  84 + $query->whereNull('certificate_end_time')->orWhere('certificate_end_time', '<', $end_day);
  85 + })->get()->toArray();
  86 + foreach ($list as $v) {
  87 + //更新证书到期时间
  88 + $data = [];
  89 + $ssl = $this->updateDomainSsl($v['domain']);
  90 + $ssl['from'] && $data['certificate_start_time'] = $ssl['from'];
  91 + $ssl['to'] && $data['certificate_end_time'] = $ssl['to'];
  92 +
  93 + $domainModel->edit($data, ['id' => $v['id']]);
  94 +
  95 + if ($v['type'] == 1 && ($data['certificate_end_time'] ?? '') < $end_day) {
  96 + //申请免费证书
48 $this->updatePrivate($v); 97 $this->updatePrivate($v);
49 } 98 }
50 } 99 }
51 } 100 }
52 - $ssl = $this->updateDomainSsl($v['domain']);  
53 - $time = $this->updateDomain($v['domain']);  
54 - if(!empty($time['start']) && !!empty($time['end'])){  
55 - $data = [  
56 - 'certificate_start_time'=>$ssl['from'],  
57 - 'certificate_end_time'=>$ssl['to'],  
58 - 'domain_start_time'=>$time['start'],  
59 - 'domain_end_time'=>$time['end']  
60 - ];  
61 - }else{  
62 - $data = [  
63 - 'domain_start_time'=>$time['start'],  
64 - 'domain_end_time'=>$time['end']  
65 - ]; 101 +
  102 + /**
  103 + * AMP站证书到期更新
  104 + * @author Akun
  105 + * @date 2024/02/26 10:26
  106 + */
  107 + public function startUpdateAmpCert()
  108 + {
  109 + $domainModel = new DomainInfoModel();
  110 + $end_day = date('Y-m-d H:i:s', time() + 2 * 24 * 3600);//2天后到期
  111 + $list = $domainModel->where('status', '!=', 2)->where('amp_status', 1)->where(function ($query) use ($end_day) {
  112 + $query->whereNull('amp_certificate_end_time')->orWhere('amp_certificate_end_time', '<', $end_day);
  113 + })->get()->toArray();
  114 + foreach ($list as $v) {
  115 + //更新amp站点证书到期时间
  116 + $domain_array = parse_url($v['domain']);
  117 + $host = $domain_array['host'] ?? $domain_array['path'];
  118 + $host_array = explode('.', $host);
  119 + if (count($host_array) <= 2) {
  120 + array_unshift($host_array, 'm');
  121 + } else {
  122 + $host_array[0] = 'm';
  123 + }
  124 + $amp_domain = implode('.', $host_array);
  125 +
  126 + $data = [];
  127 + $ssl = $this->updateDomainSsl($amp_domain);
  128 + $ssl['from'] && $data['amp_certificate_start_time'] = $ssl['from'];
  129 + $ssl['to'] && $data['amp_certificate_start_time'] = $ssl['to'];
  130 +
  131 + $domainModel->edit($data, ['id' => $v['id']]);
  132 +
  133 + if ($v['amp_type'] == 1 && ($data['amp_certificate_start_time'] ?? '') < $end_day) {
  134 + //申请免费证书
  135 + $this->updateAmpPrivate($v['domain']);
66 } 136 }
67 - $domainModel->edit($data,['id'=>$v['id']]);  
68 } 137 }
69 - return 1;  
70 } 138 }
71 139
72 /** 140 /**
@@ -78,7 +146,7 @@ class DomainInfo extends Command @@ -78,7 +146,7 @@ class DomainInfo extends Command
78 */ 146 */
79 public function updatePrivate($param) 147 public function updatePrivate($param)
80 { 148 {
81 - $url = 'https://' . $param['domain']. '/api/applySsl/'; 149 + $url = 'https://' . $param['domain'] . '/api/applySsl/';
82 $top_domain = $this->getTopDomain($param['domain']); 150 $top_domain = $this->getTopDomain($param['domain']);
83 if ((empty($extend_config) || empty($extend_config[0]['origin'])) && $param['id'] != 3) { 151 if ((empty($extend_config) || empty($extend_config[0]['origin'])) && $param['id'] != 3) {
84 $extend_config = [ 152 $extend_config = [
@@ -89,21 +157,40 @@ class DomainInfo extends Command @@ -89,21 +157,40 @@ class DomainInfo extends Command
89 'project_id' => $param['project_id'], 157 'project_id' => $param['project_id'],
90 'type' => 1, 158 'type' => 1,
91 'route' => 1, 159 'route' => 1,
92 - "domain" =>$param['domain'],  
93 - "rewrite"=> $extend_config ?? [], 160 + "domain" => $param['domain'],
  161 + "rewrite" => $extend_config ?? [],
94 'other_domain' => [$top_domain, '*.' . $top_domain], 162 'other_domain' => [$top_domain, '*.' . $top_domain],
95 'private_key' => '', 163 'private_key' => '',
96 'cert' => '' 164 'cert' => ''
97 ]; 165 ];
98 - $result = $this->curlRequest($url, $param); 166 + return $this->curlRequest($url, $param);
99 } 167 }
100 168
101 - public static function getTopDomain ($url) { 169 + /**
  170 + * 更新证书
  171 + * @param $domain
  172 + * @return array
  173 + * @author Akun
  174 + * @date 2024/02/26 10:25
  175 + */
  176 + public function updateAmpPrivate($domain)
  177 + {
  178 + $url = 'https://' . $domain . '/api/createSiteAmp/';
  179 + $param = [
  180 + "domain" => $domain,
  181 + 'private_key' => '',
  182 + 'cert' => ''
  183 + ];
  184 + return $this->curlRequest($url, $param);
  185 + }
  186 +
  187 + public static function getTopDomain($url)
  188 + {
102 $url = strtolower($url); //首先转成小写 189 $url = strtolower($url); //首先转成小写
103 $url = mb_ereg_replace('^( | )+', '', trim($url)); 190 $url = mb_ereg_replace('^( | )+', '', trim($url));
104 $url = mb_ereg_replace('( | )+$', '', $url); 191 $url = mb_ereg_replace('( | )+$', '', $url);
105 if (!preg_match('/^(http:\/\/|https)/', $url)) { 192 if (!preg_match('/^(http:\/\/|https)/', $url)) {
106 - $url = "https://".$url; 193 + $url = "https://" . $url;
107 } 194 }
108 $hosts = parse_url($url); 195 $hosts = parse_url($url);
109 $host = $hosts['host'] ?? ''; 196 $host = $hosts['host'] ?? '';
@@ -117,10 +204,10 @@ class DomainInfo extends Command @@ -117,10 +204,10 @@ class DomainInfo extends Command
117 $preg = '/[\w].+\.(com|net|org|gov|edu|co|ne)\.[\w]/'; 204 $preg = '/[\w].+\.(com|net|org|gov|edu|co|ne)\.[\w]/';
118 if (($n > 2) && preg_match($preg, $host)) { 205 if (($n > 2) && preg_match($preg, $host)) {
119 //双后缀取后3位 206 //双后缀取后3位
120 - $host = $data[$n - 3].'.'.$data[$n - 2].'.'.$data[$n - 1]; 207 + $host = $data[$n - 3] . '.' . $data[$n - 2] . '.' . $data[$n - 1];
121 } else { 208 } else {
122 //非双后缀取后两位 209 //非双后缀取后两位
123 - $host = $data[$n - 2].'.'.$data[$n - 1]; 210 + $host = $data[$n - 2] . '.' . $data[$n - 1];
124 } 211 }
125 return $host; 212 return $host;
126 } 213 }
@@ -155,30 +242,33 @@ class DomainInfo extends Command @@ -155,30 +242,33 @@ class DomainInfo extends Command
155 * @method :post 242 * @method :post
156 * @time :2023/9/11 15:07 243 * @time :2023/9/11 15:07
157 */ 244 */
158 - public function updateDomainSsl($domain){ 245 + public function updateDomainSsl($domain)
  246 + {
159 try { 247 try {
160 $context = stream_context_create([ 248 $context = stream_context_create([
161 'ssl' => [ 249 'ssl' => [
162 'capture_peer_cert' => true, 250 'capture_peer_cert' => true,
163 'capture_peer_cert_chain' => false, 251 'capture_peer_cert_chain' => false,
  252 + 'verify_peer' => false,
  253 + 'verify_peer_name' => false
164 ], 254 ],
165 ]); 255 ]);
166 - $stream = stream_socket_client('ssl://'.$domain.':443', $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);  
167 - if(!$stream) { 256 + $stream = stream_socket_client('ssl://' . $domain . ':443', $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);
  257 + if (!$stream) {
168 die("Failed to connect: $errno - $errstr"); 258 die("Failed to connect: $errno - $errstr");
169 } 259 }
170 $remote_cert = stream_context_get_params($stream)['options']['ssl']['peer_certificate']; 260 $remote_cert = stream_context_get_params($stream)['options']['ssl']['peer_certificate'];
171 - if(!$remote_cert) { 261 + if (!$remote_cert) {
172 die("Failed to retrieve certificate"); 262 die("Failed to retrieve certificate");
173 } 263 }
174 $valid_from = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validFrom_time_t']); 264 $valid_from = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validFrom_time_t']);
175 $valid_to = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validTo_time_t']); 265 $valid_to = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validTo_time_t']);
176 fclose($stream); 266 fclose($stream);
177 - }catch (\Exception $e){ 267 + } catch (\Exception $e) {
178 $valid_from = ''; 268 $valid_from = '';
179 $valid_to = ''; 269 $valid_to = '';
180 } 270 }
181 - return ['from'=>$valid_from,'to'=>$valid_to]; 271 + return ['from' => $valid_from, 'to' => $valid_to];
182 } 272 }
183 273
184 /** 274 /**
@@ -188,15 +278,16 @@ class DomainInfo extends Command @@ -188,15 +278,16 @@ class DomainInfo extends Command
188 * @method :post 278 * @method :post
189 * @time :2023/9/11 15:11 279 * @time :2023/9/11 15:11
190 */ 280 */
191 - public function updateDomain($domain){  
192 - $url = 'http://openai.waimaoq.com/v1/whois_api?domain='.$domain; 281 + public function updateDomain($domain)
  282 + {
  283 + $url = 'http://openai.waimaoq.com/v1/whois_api?domain=' . $domain;
193 $response = http_get($url); 284 $response = http_get($url);
194 $start = date('Y-m-d H:i:s'); 285 $start = date('Y-m-d H:i:s');
195 $end = date('Y-m-d H:i:s'); 286 $end = date('Y-m-d H:i:s');
196 - if($response['code'] == 200){ 287 + if ($response['code'] == 200) {
197 $start = $response['text']['creation_date']; 288 $start = $response['text']['creation_date'];
198 $end = $response['text']['expiration_date']; 289 $end = $response['text']['expiration_date'];
199 } 290 }
200 - return ['start'=>$start,'end'=>$end]; 291 + return ['start' => $start, 'end' => $end];
201 } 292 }
202 } 293 }
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: zhl
  5 + * Date: 2024/02/26
  6 + * Time: 10:13
  7 + */
  8 +namespace App\Console\Commands\KeywordInVideo;
  9 +
  10 +use App\Console\Commands\Model;
  11 +use App\Console\Commands\TaskSub;
  12 +use App\Enums\Common\Code;
  13 +use App\Models\Com\KeywordVideoTask;
  14 +use App\Models\Com\KeywordVideoTaskLog;
  15 +use App\Models\Domain\DomainInfo;
  16 +use App\Models\Product\Keyword;
  17 +use App\Models\Product\Product;
  18 +use App\Models\RouteMap\RouteMap;
  19 +use App\Services\ProjectServer;
  20 +use Illuminate\Console\Command;
  21 +use Illuminate\Support\Facades\DB;
  22 +use Illuminate\Support\Facades\Http;
  23 +use Illuminate\Support\Facades\Log;
  24 +
  25 +class VideoTask extends Command
  26 +{
  27 + /**
  28 + * The name and signature of the console command.
  29 + *
  30 + * @var string
  31 + */
  32 + protected $signature = 'video_task';
  33 +
  34 + /**
  35 + * The console command description.
  36 + *
  37 + * @var string
  38 + */
  39 + protected $description = '视频推广任务';
  40 +
  41 + /**
  42 + * Create a new command instance.
  43 + *
  44 + * @return void
  45 + */
  46 + public function __construct()
  47 + {
  48 + parent::__construct();
  49 + }
  50 +
  51 + /**
  52 + * @var int 最大子任务
  53 + */
  54 + public $max_sub_task = 800;
  55 +
  56 + /**
  57 + * @return bool
  58 + */
  59 + public function handle()
  60 + {
  61 + Log::info('开始视频推广任务');
  62 + $this->createSubTask();
  63 + $this->sendSubTask();
  64 + Log::info('结束视频推广任务');
  65 + return true;
  66 + }
  67 +
  68 + /**
  69 + * 创建子任务
  70 + * TODO 获取需要生成子任务的项目,获取项目中未生成视频的关键词,通过关键词生成初始化子任务
  71 + * @return bool
  72 + */
  73 + public function createSubTask()
  74 + {
  75 + $sub_task_num = $this->max_sub_task;
  76 + while (true) {
  77 + if ($sub_task_num <= 0){
  78 + break;
  79 + }
  80 + $task_project = KeywordVideoTask::where(['status' => KeywordVideoTask::STATUS_OPEN])->orderBy('sort', 'desc')->first();
  81 + if (empty($task_project)){
  82 + break;
  83 + }
  84 + ProjectServer::useProject($task_project->project_id);
  85 + $keyword = $this->getProjectKeyword();
  86 + // 已经没有需要生成视频的关键词
  87 + if (FALSE == $keyword->isEmpty()) {
  88 + $task_project->status = KeywordVideoTask::STATUS_CLOSE;
  89 + $task_project->save();
  90 + continue;
  91 + }
  92 + foreach ($keyword as $val) {
  93 + $log = KeywordVideoTaskLog::where(['project_id' => $task_project->project_id, 'keyword_id' => $val->id])->first();
  94 + if ($log){
  95 + continue;
  96 + }
  97 + $keywordInfo = $this->getKeywordImage($val->id,$task_project->project_id);
  98 + $array = [
  99 + 'project_id' => $task_project->project_id,
  100 + 'keyword_id' => $val->id,
  101 + 'keyword' => $val->title,
  102 + 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'], 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'], 'keywords' => []]),
  103 + 'status' => KeywordVideoTaskLog::STATUS_INIT,
  104 + 'updated_at' => date('Y-m-d H:i:s'),
  105 + 'created_at' => date('Y-m-d H:i:s'),
  106 + ];
  107 + KeywordVideoTaskLog::insert($array);
  108 + $sub_task_num--;
  109 + }
  110 + $task_project->status = KeywordVideoTask::STATUS_CLOSE;
  111 + $task_project->save();
  112 + }
  113 + return true;
  114 + }
  115 +
  116 + /**
  117 + * 发送子任务
  118 + * @return bool
  119 + */
  120 + public function sendSubTask()
  121 + {
  122 + $subTask = KeywordVideoTaskLog::where(['status' => TaskSub::STATUS_INIT])->orderBy('id', 'asc')->limit($this->max_sub_task)->get();
  123 + if ($subTask->isEmpty())
  124 + return true;
  125 + foreach ($subTask as $val) {
  126 + $valData = json_decode($val->data);
  127 + $task_id = 'v6-' . uniqid();
  128 + $data = [
  129 + 'project_data' => [
  130 + 'tag_url' => $valData['url'],
  131 + 'title' => $valData['title'],
  132 + 'keywords' => [],
  133 + 'description' => $valData['description'],
  134 + 'images' => $valData['images']
  135 + ],
  136 + 'task_id' => $task_id,
  137 + 'callback_url' => url('a/getKeywordVideo?project_id='.$val->project_id.'&keyword_id='.$val->keyword_id.'&video='),
  138 + ];
  139 + $result = Http::post('http://216.250.255.116:7866/create_task', $data);
  140 + $val->task_id = $task_id;
  141 + $val->status = KeywordVideoTaskLog::STATUS_RUNING;
  142 + $val->request_result = $result;
  143 + $val->save();
  144 + }
  145 + return true;
  146 + }
  147 +
  148 + /**
  149 + * 获取未生成页面的关键词
  150 + * @return mixed
  151 + */
  152 + public function getProjectKeyword()
  153 + {
  154 + $keyword = Keyword::where('video', null)->whereNotNull('keyword_content')->inRandomOrder()->take(100)->get();
  155 + return $keyword;
  156 + }
  157 +
  158 + /**
  159 + * 获取需要处理的任务
  160 + * @return int
  161 + */
  162 + public function getTaskProject()
  163 + {
  164 +// $task_project = Model::where(['status' => Model::STATUS_OPEN])->orderBy('sort', 'desc')->first();
  165 + $project_id = 110;
  166 + return $project_id;
  167 + }
  168 +
  169 + /**
  170 + * @remark :根据关键字获取产品主图
  171 + * @name :getKeywordList
  172 + * @author :lyh
  173 + * @method :post
  174 + * @time :2024/2/23 16:28
  175 + */
  176 + public function getKeywordImage($keyword_id,$project_id){
  177 + $keywordModel = new Keyword();
  178 + $keywordInfo = $keywordModel->read(['id'=>$keyword_id]);
  179 + $productModel = new Product();
  180 + $productList = $productModel->list(['keyword_id'=>['like','%,'.$keywordInfo['id'].',%']],['thumb','title']);
  181 + if(count($productList) < 5){
  182 + $productList = $productModel->list([],'sort',['thumb','title']);
  183 + //获取7个产品主图
  184 + }
  185 + $product_image = [];
  186 + foreach ($productList as $v){
  187 + $image = [];
  188 + if(!empty($v['thumb']) && !empty($v['thumb']['url'])){
  189 + $image['image'] = getImageUrl($v['thumb']['url']);
  190 + $image['title'] = $v['title'];
  191 + $product_image[] = $image;
  192 + }
  193 + if(count($product_image) > 6){
  194 + break;
  195 + }
  196 + }
  197 + $domainModel = new DomainInfo();
  198 + $domainInfo = $domainModel->read(['project_id'=>$project_id]);
  199 + if(!empty($domainInfo)){
  200 + $keywordInfo['route'] = $domainInfo['domain'].'/'.$keywordInfo['route'];
  201 + }
  202 + $data = [
  203 + 'url'=>$keywordInfo['route'],
  204 + 'title'=>$keywordInfo['title'],
  205 + 'keyword_title'=>$keywordInfo['keyword_title'],
  206 + 'keyword_content'=>$keywordInfo['keyword_content'],
  207 + 'product_list'=>$product_image
  208 + ];
  209 + return $data;
  210 + }
  211 +}
@@ -11,6 +11,7 @@ namespace App\Console\Commands\MonthlyCount; @@ -11,6 +11,7 @@ namespace App\Console\Commands\MonthlyCount;
11 11
12 use App\Helper\FormGlobalsoApi; 12 use App\Helper\FormGlobalsoApi;
13 use App\Models\Com\UpdateOldInfo; 13 use App\Models\Com\UpdateOldInfo;
  14 +use App\Models\Domain\DomainInfo;
14 use App\Models\HomeCount\MonthCount; 15 use App\Models\HomeCount\MonthCount;
15 use App\Models\Project\Project; 16 use App\Models\Project\Project;
16 use App\Models\Visit\Visit; 17 use App\Models\Visit\Visit;
@@ -39,7 +40,13 @@ class UpgradeProjectCount extends Command @@ -39,7 +40,13 @@ class UpgradeProjectCount extends Command
39 $project_id = $this->argument('project_id'); 40 $project_id = $this->argument('project_id');
40 $oldModel = new UpdateOldInfo(); 41 $oldModel = new UpdateOldInfo();
41 $info = $oldModel->read(['project_id'=>$project_id]); 42 $info = $oldModel->read(['project_id'=>$project_id]);
  43 + if($info !== false){
42 $url = $info['old_domain_online']; 44 $url = $info['old_domain_online'];
  45 + }else{
  46 + $domainModel = new DomainInfo();
  47 + $info = $domainModel->read(['project_id'=>$project_id]);
  48 + $url = $info['domain'];
  49 + }
43 ProjectServer::useProject($project_id); 50 ProjectServer::useProject($project_id);
44 $this->count($project_id,$url); 51 $this->count($project_id,$url);
45 DB::disconnect('custom_mysql'); 52 DB::disconnect('custom_mysql');
@@ -237,7 +237,7 @@ class SyncProject extends Command @@ -237,7 +237,7 @@ class SyncProject extends Command
237 array_push($param['api_type'],'category_news'); 237 array_push($param['api_type'],'category_news');
238 } 238 }
239 foreach ($param['api_type'] as $v_type){ 239 foreach ($param['api_type'] as $v_type){
240 - if($v_type == 'category' || $v_type == 'category_news'){ 240 + if($v_type == 'category' || $v_type == 'category_news' || $v_type == 'tag'){
241 UpdateLog::createLog($id,$v_type,$param['get_data_url']); 241 UpdateLog::createLog($id,$v_type,$param['get_data_url']);
242 }else{ 242 }else{
243 $task_list[] = $v_type; 243 $task_list[] = $v_type;
@@ -276,6 +276,7 @@ class ProjectUpdate extends Command @@ -276,6 +276,7 @@ class ProjectUpdate extends Command
276 276
277 $model = new Product(); 277 $model = new Product();
278 $category_model = new Category(); 278 $category_model = new Category();
  279 + $keyword_model = new Keyword();
279 $extend_model = new Extend(); 280 $extend_model = new Extend();
280 $extend_info_model = new ExtendInfo(); 281 $extend_info_model = new ExtendInfo();
281 $logic = new CategoryLogic(); 282 $logic = new CategoryLogic();
@@ -297,6 +298,14 @@ class ProjectUpdate extends Command @@ -297,6 +298,14 @@ class ProjectUpdate extends Command
297 $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); 298 $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
298 $category_id = $logic->getLastCategory(array_column($category_arr, 'id')); 299 $category_id = $logic->getLastCategory(array_column($category_arr, 'id'));
299 } 300 }
  301 + //关键词
  302 + $keyword_id = '';
  303 + if ($item['tags'] ?? []) {
  304 + $keyword_arr = $keyword_model->list(['title' => ['in', array_column($item['tags'], 'name')]]);
  305 + if ($keyword_arr) {
  306 + $keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ',';
  307 + }
  308 + }
300 //名称去掉特殊符号 309 //名称去掉特殊符号
301 $item['ttile'] = $this->special2str($item['ttile'] ?? ''); 310 $item['ttile'] = $this->special2str($item['ttile'] ?? '');
302 311
@@ -309,6 +318,7 @@ class ProjectUpdate extends Command @@ -309,6 +318,7 @@ class ProjectUpdate extends Command
309 'intro' => $item['short_description'] ?? '', 318 'intro' => $item['short_description'] ?? '',
310 'content' => $item['content'] ?? '', 319 'content' => $item['content'] ?? '',
311 'category_id' => $category_id, 320 'category_id' => $category_id,
  321 + 'keyword_id' => $keyword_id,
312 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', 322 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
313 'gallery' => Arr::a2s($gallery), 323 'gallery' => Arr::a2s($gallery),
314 'seo_mate' => Arr::a2s([ 324 'seo_mate' => Arr::a2s([
@@ -333,6 +343,7 @@ class ProjectUpdate extends Command @@ -333,6 +343,7 @@ class ProjectUpdate extends Command
333 'intro' => $item['short_description'] ?? '', 343 'intro' => $item['short_description'] ?? '',
334 'content' => $item['content'] ?? '', 344 'content' => $item['content'] ?? '',
335 'category_id' => $category_id, 345 'category_id' => $category_id,
  346 + 'keyword_id' => $keyword_id,
336 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', 347 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
337 'gallery' => Arr::a2s($gallery), 348 'gallery' => Arr::a2s($gallery),
338 'seo_mate' => Arr::a2s([ 349 'seo_mate' => Arr::a2s([
@@ -86,19 +86,16 @@ class QuanqiusouApi @@ -86,19 +86,16 @@ class QuanqiusouApi
86 $key = "quanqiusou_api_rank_{$api_no}_{$lang}_{$day}_" . date('Y-m-d'); 86 $key = "quanqiusou_api_rank_{$api_no}_{$lang}_{$day}_" . date('Y-m-d');
87 $res = Cache::get($key); 87 $res = Cache::get($key);
88 if (!$res || $force) { 88 if (!$res || $force) {
89 - $param = [  
90 - 'key' => '289c1fc81c89d79c04ed4fd72822948e',  
91 - 'w' => $api_no,  
92 - 'type' => $day  
93 - ];  
94 if ($lang) { 89 if ($lang) {
95 - $param['lang'] = $lang; 90 + $api_no = $api_no . '_' . $lang;
96 } 91 }
97 -  
98 - $api_url = $this->url . '/api';  
99 - 92 + $today = date('Y-m-d');
  93 + $startDay = date('Y-m-d', strtotime('-'.$day.' day'));
  94 + $endDay = date('Y-m-d', strtotime('-1 day'));
  95 + //8918_kr_2024-02-19_2024-02-25.json 8918_2024-02-19_2024-02-25.json
  96 + $api_url = "https://quanqiusou.cn/google-rank/data_json/{$today}/{$api_no}_{$startDay}_{$endDay}.json";
100 try { 97 try {
101 - $res = HttpUtils::get($api_url, $param); 98 + $res = HttpUtils::get($api_url, []);
102 if($res){ 99 if($res){
103 $res = Arr::s2a($res); 100 $res = Arr::s2a($res);
104 Cache::put($key, $res, 2 * 3600); 101 Cache::put($key, $res, 2 * 3600);
@@ -149,9 +146,9 @@ class QuanqiusouApi @@ -149,9 +146,9 @@ class QuanqiusouApi
149 */ 146 */
150 public function getHistoryCount($api_no, $lang = '') 147 public function getHistoryCount($api_no, $lang = '')
151 { 148 {
152 - $key = "quanqiusou_api_history_count_{$api_no}_{$lang}_" . date('Y-m-d');  
153 - $res = Cache::get($key);  
154 - if (!$res) { 149 +// $key = "quanqiusou_api_history_count_{$api_no}_{$lang}_" . date('Y-m-d');
  150 +// $res = Cache::get($key);
  151 +// if (!$res) {
155 $api_url = $this->url . '/google-rank/history_count.php'; 152 $api_url = $this->url . '/google-rank/history_count.php';
156 $param = [ 153 $param = [
157 'apino' => $api_no, 154 'apino' => $api_no,
@@ -163,13 +160,13 @@ class QuanqiusouApi @@ -163,13 +160,13 @@ class QuanqiusouApi
163 $res = HttpUtils::get($api_url, $param); 160 $res = HttpUtils::get($api_url, $param);
164 if($res){ 161 if($res){
165 $res = Arr::s2a($res); 162 $res = Arr::s2a($res);
166 - Cache::put($key, $res, 2 * 3600); 163 +// Cache::put($key, $res, 2 * 3600);
167 } 164 }
168 } catch (\Exception | GuzzleException $e) { 165 } catch (\Exception | GuzzleException $e) {
169 errorLog('获取历史排名统计数据失败', [], $e); 166 errorLog('获取历史排名统计数据失败', [], $e);
170 return false; 167 return false;
171 } 168 }
172 - } 169 +// }
173 return $res; 170 return $res;
174 } 171 }
175 172
@@ -17,6 +17,7 @@ use App\Services\ProjectServer; @@ -17,6 +17,7 @@ use App\Services\ProjectServer;
17 use Illuminate\Support\Facades\Cache; 17 use Illuminate\Support\Facades\Cache;
18 use Illuminate\Support\Facades\DB; 18 use Illuminate\Support\Facades\DB;
19 use Illuminate\Support\Facades\Hash; 19 use Illuminate\Support\Facades\Hash;
  20 +use Illuminate\Support\Facades\Log;
20 21
21 /** 22 /**
22 * Class IndexController 23 * Class IndexController
@@ -110,48 +111,15 @@ class IndexController extends BaseController @@ -110,48 +111,15 @@ class IndexController extends BaseController
110 * @method :post 111 * @method :post
111 * @time :2024/2/23 16:28 112 * @time :2024/2/23 16:28
112 */ 113 */
113 - public function getKeywordImage(){  
114 - $arr = explode('/',trim(str_replace('https://', '', $this->param['url']),'/'));  
115 - if(empty($arr) || !is_array($arr)){  
116 - $this->response('当前项目不存在..',Code::SYSTEM_ERROR);  
117 - }  
118 - $domainModel = new DomainInfo();  
119 - $domainInfo = $domainModel->read(['domain'=>$arr[0]]);  
120 - if($domainInfo === false){  
121 - $this->response('当前项目不存在.',Code::SYSTEM_ERROR);  
122 - }  
123 - ProjectServer::useProject($domainInfo['project_id']);  
124 - $routeMapModel = new RouteMap();  
125 - $routeInfo = $routeMapModel->read(['route'=>$arr[1]]);  
126 - if($domainInfo === false){  
127 - $this->response('当前路由不存在.',Code::SYSTEM_ERROR);  
128 - } 114 + public function getKeywordVideo(){
  115 + ProjectServer::useProject($this->param['project_id']);
129 $keywordModel = new Keyword(); 116 $keywordModel = new Keyword();
130 - $keywordInfo = $keywordModel->read(['id'=>$routeInfo['source_id']]);  
131 - $count = Product::where('keyword_id','like' ,'%,'.$keywordInfo['id'].',%')->count();  
132 - $productModel = new Product();  
133 - if($count < 5){  
134 - $productList = $productModel->list([],'sort',['thumb','title'],'desc',7);  
135 - //获取7个产品主图  
136 - }else{  
137 - $productList = $productModel->list(['keyword_id'=>['like','%,'.$keywordInfo['id'].',%']],['thumb','title'],'desc',7);  
138 - }  
139 - $product_image = [];  
140 - foreach ($productList as $k => $v){  
141 - $product_image[]['title'] = $v['title'];  
142 - if(!empty($v['thumb']) && !empty($v['thumb']['url'])){  
143 - $product_image[]['image'] = '';  
144 - $product_image[]['image'] = getImageUrl($v['thumb']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);  
145 - } 117 + $rs = $keywordModel->edit(['video'=>$this->param['video']],['id'=>$this->param['keyword_id']]);
  118 + if($rs === false){
  119 + Log::info('回调失败.'.$this->param['project_id'].'video:'.$this->param['video']);
146 } 120 }
147 - $data = [  
148 - 'title'=>$keywordInfo['title'],  
149 - 'keyword_title'=>$keywordInfo['keyword_title'],  
150 - 'keyword_content'=>$keywordInfo['keyword_content'],  
151 - 'product_list'=>$product_image  
152 - ];  
153 DB::disconnect('custom_mysql'); 121 DB::disconnect('custom_mysql');
154 - $this->response('success',Code::SUCCESS,$data); 122 + $this->response('success');
155 } 123 }
156 124
157 } 125 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :KeywordVideoController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/2/26 9:23
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Com;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Models\Com\KeywordVideoTask;
  15 +
  16 +class KeywordVideoController extends BaseController
  17 +{
  18 + /**
  19 + * @remark :任务列表
  20 + * @name :lists
  21 + * @author :lyh
  22 + * @method :post
  23 + * @time :2024/2/26 11:36
  24 + */
  25 + public function lists(){
  26 + $keywordModel = new KeywordVideoTask();
  27 + $lists = $keywordModel->lists($this->map,$this->page,$this->row);
  28 + $this->response('success',Code::SUCCESS,$lists);
  29 + }
  30 +
  31 + /**
  32 + * @remark :创建关键字任务池子
  33 + * @name :saveKeyword
  34 + * @author :lyh
  35 + * @method :post
  36 + * @time :2024/2/26 9:24
  37 + */
  38 + public function createKeywordTask(){
  39 + $this->request->validate([
  40 + 'project_id'=>'required',
  41 + 'number'=>'required'
  42 + ], [
  43 + 'project_id.required' => '项目唯一标识不为空',
  44 + 'number.required' => 'number不为空',
  45 + ]);
  46 + $keywordModel = new KeywordVideoTask();
  47 + $rs = $keywordModel->add($this->param);
  48 + if($rs === false){
  49 + $this->response('添加失败',Code::SYSTEM_ERROR);
  50 + }
  51 + $this->response('success');
  52 + }
  53 +
  54 + /**
  55 + * @remark :修改项目
  56 + * @name :editSort
  57 + * @author :lyh
  58 + * @method :post
  59 + * @time :2024/2/26 11:35
  60 + */
  61 + public function edit(){
  62 + $this->request->validate([
  63 + 'id'=>'required'
  64 + ], [
  65 + 'id.required' => '主键标识不为空',
  66 + ]);
  67 + $keywordModel = new KeywordVideoTask();
  68 + $rs = $keywordModel->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]);
  69 + if($rs === false){
  70 + $this->response('编辑失败',Code::SYSTEM_ERROR);
  71 + }
  72 + $this->response('success');
  73 + }
  74 +}
@@ -15,7 +15,7 @@ use App\Rules\Ids; @@ -15,7 +15,7 @@ use App\Rules\Ids;
15 use Illuminate\Http\Request; 15 use Illuminate\Http\Request;
16 16
17 /** 17 /**
18 - * Class KeywordController 18 + * Class KeywordVideoController
19 * @package App\Http\Controllers\Bside 19 * @package App\Http\Controllers\Bside
20 * @author zbj 20 * @author zbj
21 * @date 2023/4/15 21 * @date 2023/4/15
@@ -52,6 +52,12 @@ class UserLogic extends BaseLogic @@ -52,6 +52,12 @@ class UserLogic extends BaseLogic
52 //验证一个项目是否只有一个超级管理员 52 //验证一个项目是否只有一个超级管理员
53 $this->verifyRole($this->param); 53 $this->verifyRole($this->param);
54 if (isset($this->param['id']) && !empty($this->param['id'])) { 54 if (isset($this->param['id']) && !empty($this->param['id'])) {
  55 + $info = $this->model->read(['id'=>$this->param['id']]);
  56 + if($info['role_id'] == 0){
  57 + //更新项目信息
  58 + $projectModel = new Project();
  59 + $projectModel->edit(['lead_name'=>$this->param['name'],'mobile'=>$this->param['mobile']],['id'=>$info['project_id']]);
  60 + }
55 $this->param = $this->editPassword($this->param); 61 $this->param = $this->editPassword($this->param);
56 $rs = $this->model->edit($this->param, ['id' => $this->param['id']]); 62 $rs = $this->model->edit($this->param, ['id' => $this->param['id']]);
57 } else { 63 } else {
@@ -147,7 +147,7 @@ class CountLogic extends BaseLogic @@ -147,7 +147,7 @@ class CountLogic extends BaseLogic
147 public function referrer_count(){ 147 public function referrer_count(){
148 $customerVisitModel = new Visit(); 148 $customerVisitModel = new Visit();
149 $data = $customerVisitModel->select('referrer_url', DB::raw('COUNT(*) as count')) 149 $data = $customerVisitModel->select('referrer_url', DB::raw('COUNT(*) as count'))
150 - ->groupBy('referrer_url')->where(['domain'=>$this->user['domain']]) 150 + ->groupBy('referrer_url')->where(['domain'=>trim(str_replace('https://','',$this->user['domain']),'/')])
151 ->orderByDesc('count')->limit(9)->get()->toArray(); 151 ->orderByDesc('count')->limit(9)->get()->toArray();
152 $total = $customerVisitModel->count(); 152 $total = $customerVisitModel->count();
153 if(!empty($data)){ 153 if(!empty($data)){
@@ -30,6 +30,7 @@ class MonthCountLogic extends BaseLogic @@ -30,6 +30,7 @@ class MonthCountLogic extends BaseLogic
30 */ 30 */
31 public function getCountLists($map,$order = 'created_at',$filed = ['*']){ 31 public function getCountLists($map,$order = 'created_at',$filed = ['*']){
32 $map['project_id'] = $this->user['project_id']; 32 $map['project_id'] = $this->user['project_id'];
  33 + $new = $this->currentMonthCount();
33 $lists = $this->model->list($map,$order,$filed,'desc',10); 34 $lists = $this->model->list($map,$order,$filed,'desc',10);
34 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){ 35 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
35 foreach ($lists as $k => $v){ 36 foreach ($lists as $k => $v){
@@ -44,10 +45,11 @@ class MonthCountLogic extends BaseLogic @@ -44,10 +45,11 @@ class MonthCountLogic extends BaseLogic
44 } 45 }
45 } 46 }
46 $v['source_country'] = json_encode(array_values($source_country)); 47 $v['source_country'] = json_encode(array_values($source_country));
  48 + $v['total'] = $new['total'] ?? $v['total'];
47 $lists[$k] = $v; 49 $lists[$k] = $v;
48 } 50 }
49 } 51 }
50 - $lists['new'] = $this->currentMonthCount(); 52 + $lists['new'] = $new;
51 return $this->success($lists); 53 return $this->success($lists);
52 } 54 }
53 55
@@ -151,6 +153,7 @@ class MonthCountLogic extends BaseLogic @@ -151,6 +153,7 @@ class MonthCountLogic extends BaseLogic
151 $source = DB::connection('custom_mysql')->table('gl_customer_visit') 153 $source = DB::connection('custom_mysql')->table('gl_customer_visit')
152 ->select('referrer_url', DB::raw('COUNT(*) as count')) 154 ->select('referrer_url', DB::raw('COUNT(*) as count'))
153 ->groupBy('referrer_url') 155 ->groupBy('referrer_url')
  156 + ->where('referrer_url','!=','')
154 ->whereBetween('updated_date', [$startTime,$endTime]) 157 ->whereBetween('updated_date', [$startTime,$endTime])
155 ->orderByDesc('count')->limit(10)->get()->toArray(); 158 ->orderByDesc('count')->limit(10)->get()->toArray();
156 $arr['source'] = $source; 159 $arr['source'] = $source;
@@ -392,7 +392,7 @@ class RankDataLogic extends BaseLogic @@ -392,7 +392,7 @@ class RankDataLogic extends BaseLogic
392 if (!empty($lang_list[$api_no])) { 392 if (!empty($lang_list[$api_no])) {
393 $model = RankData::where('project_id', $project_id)->where('lang', '<>', '')->first(); 393 $model = RankData::where('project_id', $project_id)->where('lang', '<>', '')->first();
394 if (!$model || $model->updated_date != date('Y-m-d') || $force) { 394 if (!$model || $model->updated_date != date('Y-m-d') || $force) {
395 - $res = $api->getGoogleRank($api_no, 1, 7, $force); 395 + $res = $api->getGoogleRank($api_no, $model->lang, 7, $force);
396 if (!$res) { 396 if (!$res) {
397 throw new \Exception("接口数据获取失败,api_no:{$api_no},lang"); 397 throw new \Exception("接口数据获取失败,api_no:{$api_no},lang");
398 } 398 }
@@ -12,6 +12,7 @@ namespace App\Http\Logic\Bside\Scoring; @@ -12,6 +12,7 @@ namespace App\Http\Logic\Bside\Scoring;
12 use App\Http\Logic\Bside\BaseLogic; 12 use App\Http\Logic\Bside\BaseLogic;
13 use App\Models\Scoring\RatingQuestion; 13 use App\Models\Scoring\RatingQuestion;
14 use App\Models\Scoring\ScoringSystem; 14 use App\Models\Scoring\ScoringSystem;
  15 +use AWS\CRT\Log;
15 16
16 class RatingLogic extends BaseLogic 17 class RatingLogic extends BaseLogic
17 { 18 {
@@ -77,6 +78,9 @@ class RatingLogic extends BaseLogic @@ -77,6 +78,9 @@ class RatingLogic extends BaseLogic
77 } 78 }
78 $str = trim($str,'&'); 79 $str = trim($str,'&');
79 $url = "http://www.quanqiusou.cn/extend_api/api/service_score.php?postid=$postId&token=$token&ftype=$fType&$str"; 80 $url = "http://www.quanqiusou.cn/extend_api/api/service_score.php?postid=$postId&token=$token&ftype=$fType&$str";
80 - return http_get($url,['charset=utf-8']); 81 + $rs = http_get($url,['charset=utf-8']);
  82 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($url, true) . PHP_EOL, FILE_APPEND);
  83 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($rs, true) . PHP_EOL, FILE_APPEND);
  84 + return $rs;
81 } 85 }
82 } 86 }
@@ -228,6 +228,7 @@ class TranslateLogic extends BaseLogic @@ -228,6 +228,7 @@ class TranslateLogic extends BaseLogic
228 */ 228 */
229 public function translateSave(){ 229 public function translateSave(){
230 $data = []; 230 $data = [];
  231 + if(!empty($this->param['data'])){
231 //处理传递的data 232 //处理传递的data
232 foreach ($this->param['data'] as $k => $v){ 233 foreach ($this->param['data'] as $k => $v){
233 if(!empty($v) && is_array($v)){ 234 if(!empty($v) && is_array($v)){
@@ -236,6 +237,7 @@ class TranslateLogic extends BaseLogic @@ -236,6 +237,7 @@ class TranslateLogic extends BaseLogic
236 } 237 }
237 } 238 }
238 } 239 }
  240 + }
239 try { 241 try {
240 $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); 242 $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
241 if($info === false){ 243 if($info === false){
@@ -160,7 +160,7 @@ class CopyProjectJob implements ShouldQueue @@ -160,7 +160,7 @@ class CopyProjectJob implements ShouldQueue
160 $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}"); 160 $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}");
161 DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']); 161 DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']);
162 } 162 }
163 - DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据 163 +// DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据
164 DB::connection('custom_mysql')->table($table)->insertUsing( 164 DB::connection('custom_mysql')->table($table)->insertUsing(
165 [], // 列名数组,留空表示插入所有列 165 [], // 列名数组,留空表示插入所有列
166 function ($query) use ($table,$project_id) { 166 function ($query) use ($table,$project_id) {
@@ -40,7 +40,7 @@ class CollectTask extends Base @@ -40,7 +40,7 @@ class CollectTask extends Base
40 'project_id' => $project_id, 40 'project_id' => $project_id,
41 'source' => $source, 41 'source' => $source,
42 'source_id' => $source_id, 42 'source_id' => $source_id,
43 - 'domain' => $url_arr['host'] ?? $domain, 43 + 'domain' => $domain,
44 'route' => substr($url_arr['path'], 0, 1) == '/' ? $url_arr['path'] : '/' . $url_arr['path'], 44 'route' => substr($url_arr['path'], 0, 1) == '/' ? $url_arr['path'] : '/' . $url_arr['path'],
45 'language' => '', 45 'language' => '',
46 'created_at' => $now, 46 'created_at' => $now,
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :KeywordVideoTask.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/2/26 9:33
  8 + */
  9 +
  10 +namespace App\Models\Com;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +class KeywordVideoTask extends Base
  15 +{
  16 + const STATUS_OPEN = 0;
  17 + const STATUS_CLOSE = 1;//停止
  18 +
  19 + protected $table = 'gl_promotion_keyword_task';
  20 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :KeywordVideoTask.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/2/26 9:33
  8 + */
  9 +
  10 +namespace App\Models\Com;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +class KeywordVideoTaskLog extends Base
  15 +{
  16 + const STATUS_INIT = 0;
  17 + const STATUS_RUNING = 1;
  18 +
  19 + protected $table = 'gl_keyword_video_task_log';
  20 +}
@@ -33,7 +33,7 @@ class UpdateLog extends Model @@ -33,7 +33,7 @@ class UpdateLog extends Model
33 $log->project_id = $project_id; 33 $log->project_id = $project_id;
34 $log->api_type = $type; 34 $log->api_type = $type;
35 $log->api_url = $url; 35 $log->api_url = $url;
36 - $log->sort = ($type == 'category' || $type == 'category_news') ? 0 : 1; 36 + $log->sort = ($type == 'category' || $type == 'category_news' || $type == 'tag') ? 0 : 1;
37 $log->collect_status = ($type == 'category' || $type == 'category_news' || $type == 'website_info' || $type == 'tag') ? 1 : 0; 37 $log->collect_status = ($type == 'category' || $type == 'category_news' || $type == 'website_info' || $type == 'tag') ? 1 : 0;
38 return $log->save(); 38 return $log->save();
39 } 39 }
@@ -326,6 +326,15 @@ Route::middleware(['aloginauth'])->group(function () { @@ -326,6 +326,15 @@ Route::middleware(['aloginauth'])->group(function () {
326 Route::any('/del', [\App\Http\Controllers\Aside\CustomModule\CustomModuleController::class, 'del'])->name('custom_del'); 326 Route::any('/del', [\App\Http\Controllers\Aside\CustomModule\CustomModuleController::class, 'del'])->name('custom_del');
327 }); 327 });
328 328
  329 + /**
  330 + * 生成视频的项目
  331 + */
  332 + Route::prefix('keyword_video')->group(function () {
  333 + Route::any('/', [Aside\Com\KeywordVideoController::class, 'lists'])->name('promotion_keyword_lists');
  334 + Route::any('/createKeywordTask', [Aside\Com\KeywordVideoController::class, 'createKeywordTask'])->name('promotion_keyword_createKeywordTask');
  335 + Route::any('/edit', [Aside\Com\KeywordVideoController::class, 'edit'])->name('promotion_keyword_edit');
  336 + });
  337 +
329 // 公共主题模版 338 // 公共主题模版
330 Route::prefix('template')->group(function () { 339 Route::prefix('template')->group(function () {
331 Route::any('/', [Aside\Template\ATemplateController::class, 'lists'])->name('admin.ATemplate_lists'); 340 Route::any('/', [Aside\Template\ATemplateController::class, 'lists'])->name('admin.ATemplate_lists');
@@ -380,7 +389,7 @@ Route::group([], function () { @@ -380,7 +389,7 @@ Route::group([], function () {
380 Route::any('/collect', [Aside\Collect\CollectController::class, 'index'])->name('admin.collect'); 389 Route::any('/collect', [Aside\Collect\CollectController::class, 'index'])->name('admin.collect');
381 //同步询盘 390 //同步询盘
382 Route::any('/sync_inquiry', [Aside\Com\IndexController::class, 'sync_inquiry'])->name('admin.sync_inquiry'); 391 Route::any('/sync_inquiry', [Aside\Com\IndexController::class, 'sync_inquiry'])->name('admin.sync_inquiry');
383 - Route::any('/getKeywordImage', [Aside\Com\IndexController::class, 'getKeywordImage'])->name('admin.getKeywordImage'); 392 + Route::any('/getKeywordVideo', [Aside\Com\IndexController::class, 'getKeywordVideo'])->name('admin.getKeywordVideo');
384 }); 393 });
385 394
386 395