作者 刘锟

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

@@ -12,6 +12,7 @@ namespace App\Console\Commands\Ai; @@ -12,6 +12,7 @@ namespace App\Console\Commands\Ai;
12 use App\Models\Ai\AiBlog; 12 use App\Models\Ai\AiBlog;
13 use App\Models\Ai\AiBlogAuthor; 13 use App\Models\Ai\AiBlogAuthor;
14 use App\Models\Ai\AiBlogList; 14 use App\Models\Ai\AiBlogList;
  15 +use App\Models\Domain\DomainInfo;
15 use App\Models\Project\ProjectAiSetting; 16 use App\Models\Project\ProjectAiSetting;
16 use App\Models\RouteMap\RouteMap; 17 use App\Models\RouteMap\RouteMap;
17 use App\Services\AiBlogService; 18 use App\Services\AiBlogService;
@@ -51,6 +52,7 @@ class AiBlogListTask extends Command @@ -51,6 +52,7 @@ class AiBlogListTask extends Command
51 $projectAiSettingModel = new ProjectAiSetting(); 52 $projectAiSettingModel = new ProjectAiSetting();
52 $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$project_id]); 53 $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$project_id]);
53 $this->updateBlogList($aiSettingInfo); 54 $this->updateBlogList($aiSettingInfo);
  55 + $this->curlDelRoute($project_id);
54 DB::disconnect('custom_mysql'); 56 DB::disconnect('custom_mysql');
55 return true; 57 return true;
56 } 58 }
@@ -96,4 +98,24 @@ class AiBlogListTask extends Command @@ -96,4 +98,24 @@ class AiBlogListTask extends Command
96 } 98 }
97 return true; 99 return true;
98 } 100 }
  101 +
  102 + /**
  103 + * @remark :通知C端生成界面
  104 + * @name :sendNotice
  105 + * @author :lyh
  106 + * @method :post
  107 + * @time :2025/3/6 11:51
  108 + */
  109 + public function curlDelRoute($project_id){
  110 + $domainModel = new DomainInfo();
  111 + //获取项目域名
  112 + $domain = $domainModel->getProjectIdDomain($project_id);
  113 + if(!empty($domain)){
  114 + $url = $domain.'api/update_page/?project_id='.$project_id.'&route=7';
  115 + shell_exec('curl -k "'.$url.'"');
  116 + }else{
  117 + echo '域名不存在:' . $project_id . PHP_EOL . date('Y-m-d H:i:s');
  118 + }
  119 + return true;
  120 + }
99 } 121 }
@@ -145,11 +145,10 @@ class WeekProject extends Command @@ -145,11 +145,10 @@ class WeekProject extends Command
145 } 145 }
146 146
147 /** 147 /**
148 - * @remark :推送消息  
149 - * @name :workChatMessage  
150 - * @author :lyh  
151 - * @method :post  
152 - * @time :2025/2/26 10:15 148 + * 周报消息推送消息入库
  149 + * @param $data
  150 + * @param $project_id
  151 + * @return bool
153 */ 152 */
154 public function workChatMessage($data,$project_id){ 153 public function workChatMessage($data,$project_id){
155 $arr = []; 154 $arr = [];
@@ -227,7 +226,7 @@ class WeekProject extends Command @@ -227,7 +226,7 @@ class WeekProject extends Command
227 if(!empty($data['daily_average_num'])){ 226 if(!empty($data['daily_average_num'])){
228 $content2 .= '本周日均访客量:'.$data['daily_average_num'].'+。'; 227 $content2 .= '本周日均访客量:'.$data['daily_average_num'].'+。';
229 } 228 }
230 - $content2 .= '全球搜建议用户持续分析、选择、添加企业、产品、服务等相关关键词进行优化和监控,以覆盖更多相关排名和流量;'; 229 + $content2 .= PHP_EOL.'全球搜建议用户持续分析、选择、添加企业、产品、服务等相关关键词进行优化和监控,以覆盖更多相关排名和流量;';
231 } 230 }
232 if(!empty($content2)){ 231 if(!empty($content2)){
233 $arr[] = $content2; 232 $arr[] = $content2;
@@ -252,7 +251,7 @@ class WeekProject extends Command @@ -252,7 +251,7 @@ class WeekProject extends Command
252 $content3 .= '新闻:'.$data['week_news_num'].'条。'; 251 $content3 .= '新闻:'.$data['week_news_num'].'条。';
253 } 252 }
254 } 253 }
255 - $content3 .= '全球搜建议用户保持网站内容的持续更新与完善,可参考谷歌关于创建实用、可靠、以用户为中心的内容的相关建议:https://developers.google.com/search/docs/fundamentals/creating-helpful-content?hl=zh-cn;'; 254 + $content3 .= PHP_EOL.'全球搜建议用户保持网站内容的持续更新与完善,可参考谷歌关于创建实用、可靠、以用户为中心的内容的相关建议:https://developers.google.com/search/docs/fundamentals/creating-helpful-content?hl=zh-cn;';
256 } 255 }
257 if(!empty($content3)){ 256 if(!empty($content3)){
258 $arr[] = $content3; 257 $arr[] = $content3;
@@ -264,9 +263,6 @@ class WeekProject extends Command @@ -264,9 +263,6 @@ class WeekProject extends Command
264 if(!empty($data['aggregation_update_num'])){ 263 if(!empty($data['aggregation_update_num'])){
265 $content4 .= '聚合页主站页面更新'.$data['aggregation_update_num'].'次。'; 264 $content4 .= '聚合页主站页面更新'.$data['aggregation_update_num'].'次。';
266 } 265 }
267 - if(!empty($data['aggregation_update_num'])){  
268 - $content4 .= '聚合页主站页面更新'.$data['aggregation_update_num'].'次。';  
269 - }  
270 if(!empty($data['minor_update_num'])){ 266 if(!empty($data['minor_update_num'])){
271 $content4 .= '小语种站页面更新'.$data['minor_update_num'].'次。'; 267 $content4 .= '小语种站页面更新'.$data['minor_update_num'].'次。';
272 } 268 }
@@ -274,7 +270,7 @@ class WeekProject extends Command @@ -274,7 +270,7 @@ class WeekProject extends Command
274 $content4 .= '聚合页小语种站页面'.$data['aggregation_minor_update_num'].'次。'; 270 $content4 .= '聚合页小语种站页面'.$data['aggregation_minor_update_num'].'次。';
275 } 271 }
276 if(!empty($content4)){ 272 if(!empty($content4)){
277 - $content4 = '本周主要优化工作包括:TDK、H标签、Img标签等优化设置排查与进一步完善,Sitemap更新与网页收录提交,外链新增与排查。'.$content4; 273 + $content4 = PHP_EOL.'本周主要优化工作包括:TDK、H标签、Img标签等优化设置排查与进一步完善,Sitemap更新与网页收录提交,外链新增与排查。'.$content4;
278 } 274 }
279 if(!empty($content4)){ 275 if(!empty($content4)){
280 $arr[] = $content4; 276 $arr[] = $content4;
@@ -283,7 +279,7 @@ class WeekProject extends Command @@ -283,7 +279,7 @@ class WeekProject extends Command
283 return true; 279 return true;
284 } 280 }
285 foreach ($arr as $key => $val){ 281 foreach ($arr as $key => $val){
286 - $content .= ($key+1).','.$val.PHP_EOL; 282 + $content .= ($key+1).','.$val.PHP_EOL.PHP_EOL;
287 } 283 }
288 $timestamp = strtotime('tomorrow 9:00 AM'); 284 $timestamp = strtotime('tomorrow 9:00 AM');
289 $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp); 285 $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
@@ -291,11 +287,12 @@ class WeekProject extends Command @@ -291,11 +287,12 @@ class WeekProject extends Command
291 return true; 287 return true;
292 } 288 }
293 $tips = 'Tips:'.PHP_EOL.'1、全球搜V6.0系统提供网页TDK、H标签、Img标签等用户自定义编辑接口且辅以AI创作工具,用户可进一步对相关优化设置进行精细化优化与调整;'.PHP_EOL.'2、全球搜V6.0系统提供小语种页面精准校对翻译功能,用户可进一步对已翻译小语种页面进行人工翻译校对;'.PHP_EOL.'3、全球搜V6.0系统支持绑定Facebook、LinkedIn、X(原Twitter)等社媒账号,可一键同步转发网站上发布的产品和新闻至社媒账号动态,建议用户用起来哦;'.PHP_EOL.'4、如用户有较丰富的企业、产品、服务相关视频素材,全球搜建议用户及时创建YouTube主页,并在YouTube和网站相关网页上同步发布视频;'; 289 $tips = 'Tips:'.PHP_EOL.'1、全球搜V6.0系统提供网页TDK、H标签、Img标签等用户自定义编辑接口且辅以AI创作工具,用户可进一步对相关优化设置进行精细化优化与调整;'.PHP_EOL.'2、全球搜V6.0系统提供小语种页面精准校对翻译功能,用户可进一步对已翻译小语种页面进行人工翻译校对;'.PHP_EOL.'3、全球搜V6.0系统支持绑定Facebook、LinkedIn、X(原Twitter)等社媒账号,可一键同步转发网站上发布的产品和新闻至社媒账号动态,建议用户用起来哦;'.PHP_EOL.'4、如用户有较丰富的企业、产品、服务相关视频素材,全球搜建议用户及时创建YouTube主页,并在YouTube和网站相关网页上同步发布视频;';
  290 + $message = "【全球搜V6.0周报】- 项目ID:" . PHP_EOL . $content . PHP_EOL . $tips;
294 $param = [ 291 $param = [
295 'project_id'=>$project_id, 292 'project_id'=>$project_id,
296 'friend_id'=>$friend_id, 293 'friend_id'=>$friend_id,
297 'type'=>MessagePush::TYPE_WEEK, 294 'type'=>MessagePush::TYPE_WEEK,
298 - 'content'=>"【全球搜V6.0周报】".PHP_EOL.$content.PHP_EOL.$tips, 295 + 'content'=> $message,
299 'ref_ids'=>'', 296 'ref_ids'=>'',
300 'send_time'=>$tomorrowNineAM, 297 'send_time'=>$tomorrowNineAM,
301 'status'=>0, 298 'status'=>0,
@@ -9,10 +9,6 @@ use App\Http\Requests\Bside\Ai\AiBlogRequest; @@ -9,10 +9,6 @@ use App\Http\Requests\Bside\Ai\AiBlogRequest;
9 use App\Models\Ai\AiBlog; 9 use App\Models\Ai\AiBlog;
10 use App\Models\Ai\AiBlogAuthor; 10 use App\Models\Ai\AiBlogAuthor;
11 use App\Models\Ai\AiBlogList; 11 use App\Models\Ai\AiBlogList;
12 -use App\Models\RouteMap\RouteMap;  
13 -use App\Services\AiBlogService;  
14 -use App\Services\ProjectServer;  
15 -use Illuminate\Support\Facades\DB;  
16 12
17 class AiBlogController extends BaseController 13 class AiBlogController extends BaseController
18 { 14 {
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :KeywordUrlController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/3/12 17:01
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Bside\Product;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Bside\BaseController;
  14 +use App\Http\Logic\Bside\Product\KeywordUrlLogic;
  15 +use App\Models\Product\KeywordUrl;
  16 +
  17 +/**
  18 + * @remark :关键词设置
  19 + * @name :KeywordUrlController
  20 + * @author :lyh
  21 + * @method :post
  22 + * @time :2025/3/12 17:01
  23 + */
  24 +class KeywordUrlController extends BaseController
  25 +{
  26 + /**
  27 + * @remark :关键词设置列表
  28 + * @name :lists
  29 + * @author :lyh
  30 + * @method :post
  31 + * @time :2025/3/12 17:01
  32 + * @param :keyword->关键字
  33 + */
  34 + public function lists(KeywordUrl $keywordUrl){
  35 + if(isset($this->map['keyword']) && !empty($this->map['keyword'])){
  36 + $this->map['keyword'] = ['like','%'.$this->map['keyword'].'%'];
  37 + }
  38 + $filed = ['id','keyword','url','created_at','updated_at'];
  39 + $lists = $keywordUrl->lists($this->map,$this->page,$this->row,$this->order,$filed);
  40 + $this->response('success',Code::SUCCESS,$lists);
  41 + }
  42 +
  43 + /**
  44 + * @remark :获取数据详情
  45 + * @name :info
  46 + * @author :lyh
  47 + * @method :post
  48 + * @time :2025/3/12 17:25
  49 + */
  50 + public function info(KeywordUrl $keywordUrl){
  51 + $this->request->validate([
  52 + 'id'=>['required'],
  53 + ],[
  54 + 'id.required' => 'id不能为空',
  55 + ]);
  56 + $lists = $keywordUrl->read(['id'=>$this->param['id']]);
  57 + $this->response('success',Code::SUCCESS,$lists);
  58 + }
  59 +
  60 + /**
  61 + * @remark :保存数据
  62 + * @name :save
  63 + * @author :lyh
  64 + * @method :post
  65 + * @time :2025/3/12 17:02
  66 + * @param :keyword->关键词; url->对应路由
  67 + */
  68 + public function save(KeywordUrlLogic $keywordUrlLogic){
  69 + $this->request->validate([
  70 + 'keyword'=>['required'],
  71 + 'url'=>['required'],
  72 + ],[
  73 + 'keyword.required' => 'keyword不能为空',
  74 + 'url.required' => 'url不能为空',
  75 + ]);
  76 + $result = $keywordUrlLogic->saveKeywordUrl();
  77 + $this->response('success',Code::SUCCESS,$result);
  78 + }
  79 +
  80 + /**
  81 + * @remark :删除数据
  82 + * @name :del
  83 + * @author :lyh
  84 + * @method :post
  85 + * @time :2025/3/12 17:02
  86 + */
  87 + public function del(KeywordUrl $keywordUrl){
  88 + $this->request->validate([
  89 + 'id'=>['required'],
  90 + ],[
  91 + 'id.required' => 'id不能为空',
  92 + ]);
  93 + $result = $keywordUrl->del($this->param);
  94 + $this->response('success',Code::SUCCESS,$result);
  95 + }
  96 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :WebSettingYoutubeController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/3/12 15:36
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Bside\Setting;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Bside\BaseController;
  14 +use App\Models\WebSetting\WebSettingYoutube;
  15 +
  16 +class WebSettingYoutubeController extends BaseController
  17 +{
  18 + /**
  19 + * @remark :获取当前项目的youtube
  20 + * @name :getInfo
  21 + * @author :lyh
  22 + * @method :post
  23 + * @time :2025/3/12 15:37
  24 + */
  25 + public function getYoutubeInfo(WebSettingYoutube $webSettingYoutube){
  26 + $data = $webSettingYoutube->read(['project_id'=>$this->user['project_id']]);
  27 + $this->response('success',Code::SUCCESS,$data);
  28 + }
  29 +
  30 + /**
  31 + * @remark :保存youtube账号密码
  32 + * @name :saveYoutube
  33 + * @author :lyh
  34 + * @method :post
  35 + * @time :2025/3/12 15:39
  36 + * @param :account->账号;password->密码
  37 + */
  38 + public function saveYoutube(WebSettingYoutube $webSettingYoutube){
  39 + $this->request->validate([
  40 + 'account'=>'required',
  41 + 'password'=>'required',
  42 + ],[
  43 + 'account.required' => 'account不能为空',
  44 + 'password.required' => 'password不能为空',
  45 + ]);
  46 + $info = $webSettingYoutube->read(['project_id'=>$this->user['project_id']]);
  47 + if($info === false){
  48 + $this->param['project_id'] = $this->user['project_id'];
  49 + $id = $webSettingYoutube->addReturnId($this->param);
  50 + }else{
  51 + $id = $info['id'];
  52 + $webSettingYoutube->edit($this->param,['project_id'=>$this->user['project_id']]);
  53 + }
  54 + $this->response('success',Code::SUCCESS,['id'=>$id]);
  55 + }
  56 +}
@@ -6,9 +6,7 @@ use App\Helper\Translate; @@ -6,9 +6,7 @@ use App\Helper\Translate;
6 use App\Http\Logic\Bside\BaseLogic; 6 use App\Http\Logic\Bside\BaseLogic;
7 use App\Models\Ai\AiBlog; 7 use App\Models\Ai\AiBlog;
8 use App\Models\Ai\AiBlogAuthor; 8 use App\Models\Ai\AiBlogAuthor;
9 -use App\Models\Ai\AiBlogList;  
10 use App\Models\Project\AiBlogTask; 9 use App\Models\Project\AiBlogTask;
11 -use App\Models\Project\Project;  
12 use App\Models\Project\ProjectAiSetting; 10 use App\Models\Project\ProjectAiSetting;
13 use App\Models\RouteMap\RouteMap; 11 use App\Models\RouteMap\RouteMap;
14 use App\Services\AiBlogService; 12 use App\Services\AiBlogService;
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :KeywordUrlLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/3/12 17:06
  8 + */
  9 +
  10 +namespace App\Http\Logic\Bside\Product;
  11 +
  12 +use App\Http\Logic\Bside\BaseLogic;
  13 +use App\Models\Product\KeywordUrl;
  14 +
  15 +/**
  16 + * @remark :关键词设置
  17 + * @name :KeywordUrlLogic
  18 + * @author :lyh
  19 + * @method :post
  20 + * @time :2025/3/12 17:07
  21 + */
  22 +class KeywordUrlLogic extends BaseLogic
  23 +{
  24 + public function __construct()
  25 + {
  26 + parent::__construct();
  27 + $this->param = $this->requestAll;
  28 + $this->model = new KeywordUrl();
  29 + }
  30 +
  31 + /**
  32 + * @remark :保存数据
  33 + * @name :saveKeywordUrl
  34 + * @author :lyh
  35 + * @method :post
  36 + * @time :2025/3/12 17:08
  37 + */
  38 + public function saveKeywordUrl(){
  39 + if(isset($this->param['id']) && !empty($this->param['id'])){
  40 + $id = $this->param['id'];
  41 + $this->model->edit($this->param,['id'=>$this->param['id']]);
  42 + }else{
  43 + $id = $this->model->addReturnId($this->param);
  44 + }
  45 + return $this->success(['id'=>$id]);
  46 + }
  47 +
  48 +
  49 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :KeywordUrl.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/3/12 16:59
  8 + */
  9 +
  10 +namespace App\Models\Product;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :关键词设置
  16 + * @name :KeywordUrl
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/3/12 17:00
  20 + */
  21 +class KeywordUrl extends Base
  22 +{
  23 + //设置关联表名
  24 + protected $table = 'gl_keyword_url';
  25 + //连接数据库
  26 + protected $connection = 'custom_mysql';
  27 +}
1 <?php 1 <?php
2 /** 2 /**
3 * @remark : 3 * @remark :
4 - * @name :WebSettingYoutube.php 4 + * @name :WebSettingYoutubeController.php
5 * @author :lyh 5 * @author :lyh
6 * @method :post 6 * @method :post
7 * @time :2025/3/11 15:51 7 * @time :2025/3/11 15:51
@@ -13,7 +13,7 @@ use App\Models\Base; @@ -13,7 +13,7 @@ use App\Models\Base;
13 13
14 /** 14 /**
15 * @remark :youtube账号密码设置 15 * @remark :youtube账号密码设置
16 - * @name :WebSettingYoutube 16 + * @name :WebSettingYoutubeController
17 * @author :lyh 17 * @author :lyh
18 * @method :post 18 * @method :post
19 * @time :2025/3/11 15:51 19 * @time :2025/3/11 15:51
@@ -21,4 +21,6 @@ use App\Models\Base; @@ -21,4 +21,6 @@ use App\Models\Base;
21 class WebSettingYoutube extends Base 21 class WebSettingYoutube extends Base
22 { 22 {
23 protected $table = 'gl_web_setting_youtube'; 23 protected $table = 'gl_web_setting_youtube';
  24 + //连接数据库
  25 + protected $connection = 'custom_mysql';
24 } 26 }
@@ -666,7 +666,20 @@ Route::middleware(['bloginauth'])->group(function () { @@ -666,7 +666,20 @@ Route::middleware(['bloginauth'])->group(function () {
666 Route::prefix('auto_email_content')->group(function () { 666 Route::prefix('auto_email_content')->group(function () {
667 Route::any('/getContent', [\App\Http\Controllers\Bside\Subscribe\AutoEmailContentController::class, 'getContent'])->name('auto_email_content_getContent'); 667 Route::any('/getContent', [\App\Http\Controllers\Bside\Subscribe\AutoEmailContentController::class, 'getContent'])->name('auto_email_content_getContent');
668 Route::any('/saveContent', [\App\Http\Controllers\Bside\Subscribe\AutoEmailContentController::class, 'saveContent'])->name('auto_email_content_saveContent'); 668 Route::any('/saveContent', [\App\Http\Controllers\Bside\Subscribe\AutoEmailContentController::class, 'saveContent'])->name('auto_email_content_saveContent');
  669 + });
  670 +
  671 + //seo白帽 youtube账号密码设置
  672 + Route::prefix('youtube')->group(function () {
  673 + Route::any('/info', [\App\Http\Controllers\Bside\Setting\WebSettingYoutubeController::class, 'getYoutubeInfo'])->name('youtube_getYoutubeInfo');
  674 + Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingYoutubeController::class, 'saveYoutube'])->name('youtube_saveYoutube');
  675 + });
669 676
  677 + //seo白帽 关键词设置
  678 + Route::prefix('keyword_url')->group(function () {
  679 + Route::any('/', [\App\Http\Controllers\Bside\Product\KeywordUrlController::class, 'lists'])->name('keyword_url_lists');
  680 + Route::any('/info', [\App\Http\Controllers\Bside\Product\KeywordUrlController::class, 'info'])->name('keyword_url_info');
  681 + Route::any('/save', [\App\Http\Controllers\Bside\Product\KeywordUrlController::class, 'save'])->name('keyword_url_save');
  682 + Route::any('/del', [\App\Http\Controllers\Bside\Product\KeywordUrlController::class, 'del'])->name('keyword_url_del');
670 }); 683 });
671 }); 684 });
672 //无需登录验证的路由组 685 //无需登录验证的路由组