作者 刘锟

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

@@ -13,6 +13,7 @@ use App\Console\Commands\Domain\DomainInfo; @@ -13,6 +13,7 @@ use App\Console\Commands\Domain\DomainInfo;
13 use App\Http\Logic\Aside\Project\ProjectLogic; 13 use App\Http\Logic\Aside\Project\ProjectLogic;
14 use App\Models\Ai\AiBlog; 14 use App\Models\Ai\AiBlog;
15 use App\Models\Ai\AiBlogAuthor; 15 use App\Models\Ai\AiBlogAuthor;
  16 +use App\Models\Ai\AiCommand;
16 use App\Models\Com\NoticeLog; 17 use App\Models\Com\NoticeLog;
17 use App\Models\Com\V6WeeklyReport; 18 use App\Models\Com\V6WeeklyReport;
18 use App\Models\Product\Category; 19 use App\Models\Product\Category;
@@ -31,6 +32,7 @@ use App\Models\WebSetting\WebLanguage; @@ -31,6 +32,7 @@ use App\Models\WebSetting\WebLanguage;
31 use App\Models\WebSetting\WebSetting; 32 use App\Models\WebSetting\WebSetting;
32 use App\Models\Workchat\MessagePush; 33 use App\Models\Workchat\MessagePush;
33 use App\Services\AiBlogService; 34 use App\Services\AiBlogService;
  35 +use App\Services\AiCommandService;
34 use App\Services\ProjectServer; 36 use App\Services\ProjectServer;
35 use Illuminate\Console\Command; 37 use Illuminate\Console\Command;
36 use Illuminate\Support\Facades\Schema; 38 use Illuminate\Support\Facades\Schema;
@@ -54,7 +56,40 @@ class lyhDemo extends Command @@ -54,7 +56,40 @@ class lyhDemo extends Command
54 protected $description = '更新路由'; 56 protected $description = '更新路由';
55 57
56 public function handle(){ 58 public function handle(){
57 - return true; 59 + $projectModel = new Project();
  60 + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']);
  61 + foreach ($lists as $item){
  62 + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
  63 + ProjectServer::useProject($item['id']);
  64 + $authorModel = new AiBlogAuthor();
  65 + $author_list = $authorModel->list(['id'=>['>',0]]);
  66 + if(empty($author_list)){
  67 + echo '跳过的项目id:'.$item['id'].PHP_EOL;
  68 + DB::disconnect('custom_mysql');
  69 + continue;
  70 + }
  71 + $projectAiSettingModel = new ProjectAiSetting();
  72 + $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$item['id']]);
  73 + if($aiSettingInfo === false){
  74 + echo '跳过的项目id:'.$item['id'].PHP_EOL;
  75 + DB::disconnect('custom_mysql');
  76 + continue;
  77 + }
  78 + $aiBlogService = new AiBlogService($item['id']);
  79 + foreach ($author_list as $val){
  80 + $aiBlogService->author_id = $val['author_id'];
  81 + $result = $aiBlogService->getAuthorDetail();
  82 + if(isset($result['status']) && $result['status'] == 200){
  83 + //当前作者的页面
  84 + $aiBlogAuthorModel = new AiBlogAuthor();
  85 + $authorInfo = $aiBlogAuthorModel->read(['author_id'=>$val['author_id']],['id','route']);
  86 + if($authorInfo !== false && !empty($result['data']['section'])){
  87 + $aiBlogAuthorModel->edit(['text'=>$result['data']['section']],['author_id'=>$val['author_id']]);
  88 + }
  89 + }
  90 + }
  91 + DB::disconnect('custom_mysql');
  92 + }
58 } 93 }
59 94
60 public function _actionTemplateMain(){ 95 public function _actionTemplateMain(){
@@ -10,6 +10,7 @@ use App\Models\Subscribe\Smtp; @@ -10,6 +10,7 @@ use App\Models\Subscribe\Smtp;
10 use App\Models\Workchat\MessagePush; 10 use App\Models\Workchat\MessagePush;
11 use App\Services\Aside\ProjectAssociation\ProjectAssociationServices; 11 use App\Services\Aside\ProjectAssociation\ProjectAssociationServices;
12 use Illuminate\Console\Command; 12 use Illuminate\Console\Command;
  13 +use Illuminate\Http\Client\ConnectionException;
13 use Illuminate\Support\Facades\Config; 14 use Illuminate\Support\Facades\Config;
14 use Illuminate\Support\Facades\Mail; 15 use Illuminate\Support\Facades\Mail;
15 16
@@ -44,6 +45,10 @@ class WorkchatMessageSend extends Command @@ -44,6 +45,10 @@ class WorkchatMessageSend extends Command
44 ProjectAssociationServices::getInstance()->sendMessage($task->friend_id, $task->content, $task->content_type); 45 ProjectAssociationServices::getInstance()->sendMessage($task->friend_id, $task->content, $task->content_type);
45 $this->output('推送消息' . $task->id . '成功'); 46 $this->output('推送消息' . $task->id . '成功');
46 $task->status = MessagePush::STATUS_SUCCESS; 47 $task->status = MessagePush::STATUS_SUCCESS;
  48 + }catch (ConnectionException $e){
  49 + $this->output('推送消息' . $task->id . '超时');
  50 + $task->status = MessagePush::STATUS_ERROR;
  51 + $task->remark = '请求超时';
47 }catch (\Exception $e){ 52 }catch (\Exception $e){
48 $this->output('推送消息' . $task->id . '失败:' . $e->getMessage()); 53 $this->output('推送消息' . $task->id . '失败:' . $e->getMessage());
49 $task->status = MessagePush::STATUS_ERROR; 54 $task->status = MessagePush::STATUS_ERROR;
@@ -6,6 +6,7 @@ namespace App\Console\Commands\Test; @@ -6,6 +6,7 @@ namespace App\Console\Commands\Test;
6 6
7 use App\Helper\Common; 7 use App\Helper\Common;
8 use App\Helper\FormGlobalsoApi; 8 use App\Helper\FormGlobalsoApi;
  9 +use App\Models\Ai\AiCommand;
9 use App\Models\Domain\DomainInfo; 10 use App\Models\Domain\DomainInfo;
10 use App\Models\HomeCount\Count; 11 use App\Models\HomeCount\Count;
11 use App\Models\Inquiry\InquiryFormData; 12 use App\Models\Inquiry\InquiryFormData;
@@ -17,6 +18,7 @@ use App\Models\Project\ProjectUpdateTdk; @@ -17,6 +18,7 @@ use App\Models\Project\ProjectUpdateTdk;
17 use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel; 18 use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel;
18 use App\Models\WebSetting\Translate as TranslateModel; 19 use App\Models\WebSetting\Translate as TranslateModel;
19 use App\Models\WebSetting\WebLanguage; 20 use App\Models\WebSetting\WebLanguage;
  21 +use App\Services\AiCommandService;
20 use App\Services\ProjectServer; 22 use App\Services\ProjectServer;
21 use Carbon\Carbon; 23 use Carbon\Carbon;
22 use Illuminate\Console\Command; 24 use Illuminate\Console\Command;
@@ -60,6 +62,13 @@ class Test extends Command @@ -60,6 +62,13 @@ class Test extends Command
60 */ 62 */
61 public function handle() 63 public function handle()
62 { 64 {
  65 + $string = '';
  66 + $promote = AiCommand::where(['key' => 'ai_layout_design'])->frist();
  67 + $promote = str_replace("{html}", $string, $promote->ai);
  68 + $aiCommandService = new AiCommandService();
  69 + $result = $aiCommandService->send_layout_design($promote);
  70 + dd($result);
  71 +
63 $string = 'eyJpdiI6ImxDWW96VUdGVk5QcEZ5dnRyd2lzVkE9PSIsInZhbHVlIjoiRGJSRXdQZDdtMFp1Tjh5c21jTWRKbjh4SWNMeWpRR1hWdE1HdVR3cEI5MjNYdjA0d2hKemV5ZjFoNUd4enNKaklaNXZwUUFtbDhIUkxyckVwYTJ6YnE3V2pMdmUyeU5lblNPQXNsbHl2U0hFOTZ1NERTTStUb2dnQmhMTzZMMXVCV0REeiszQ3NcL0l1ZGhTSkI5a3J3TkRoVFhteHpFcXpcL3FwRkVGVG1sN2xBTlFJemZiZ3N1Sk1PT3Z2T1Jld2MiLCJtYWMiOiIzZmU5OTRiZTMyNWZhNzczMzUzZTc1YjFlODg0MGFhNDJlM2Q2MDhhMDY4YWQxNWFlNjNlYjczYmJmZThkOWJlIn0%3D'; 72 $string = 'eyJpdiI6ImxDWW96VUdGVk5QcEZ5dnRyd2lzVkE9PSIsInZhbHVlIjoiRGJSRXdQZDdtMFp1Tjh5c21jTWRKbjh4SWNMeWpRR1hWdE1HdVR3cEI5MjNYdjA0d2hKemV5ZjFoNUd4enNKaklaNXZwUUFtbDhIUkxyckVwYTJ6YnE3V2pMdmUyeU5lblNPQXNsbHl2U0hFOTZ1NERTTStUb2dnQmhMTzZMMXVCV0REeiszQ3NcL0l1ZGhTSkI5a3J3TkRoVFhteHpFcXpcL3FwRkVGVG1sN2xBTlFJemZiZ3N1Sk1PT3Z2T1Jld2MiLCJtYWMiOiIzZmU5OTRiZTMyNWZhNzczMzUzZTc1YjFlODg0MGFhNDJlM2Q2MDhhMDY4YWQxNWFlNjNlYjczYmJmZThkOWJlIn0%3D';
64 $string_aicc = 'eyJpdiI6ImE0UDhxK25EY3RXLzI3bGZYM3BRVUE9PSIsInZhbHVlIjoiZ01IN0JBMmpNQ0EwWjJ5VmhMVFNrS2ZlRjY3ZmVpRExtdjh3MTQ4enkyK2gzMjJCajV1QXNKYjA4YlV6Z0dVMU0xMWdOTmJXZ0NWTDdRS3lSUWNhNmJsUW5qc0pIYjE4cm40ZkVXNkdibWVnSVR2dG4wUVp5Y1MyU3RrUnJZd3RCa1IzZ05nRC9FVUt5Q2xuZmVYNDFnPT0iLCJtYWMiOiIyZjZiYmRjNWY5N2E0MGUxNjAzNWYxZjVlMGUyNWE2OTk0MzhiY2UyYWNkYzY5MzA0YmJmYmYzNjM1YjIyY2QwIn0='; 73 $string_aicc = 'eyJpdiI6ImE0UDhxK25EY3RXLzI3bGZYM3BRVUE9PSIsInZhbHVlIjoiZ01IN0JBMmpNQ0EwWjJ5VmhMVFNrS2ZlRjY3ZmVpRExtdjh3MTQ4enkyK2gzMjJCajV1QXNKYjA4YlV6Z0dVMU0xMWdOTmJXZ0NWTDdRS3lSUWNhNmJsUW5qc0pIYjE4cm40ZkVXNkdibWVnSVR2dG4wUVp5Y1MyU3RrUnJZd3RCa1IzZ05nRC9FVUt5Q2xuZmVYNDFnPT0iLCJtYWMiOiIyZjZiYmRjNWY5N2E0MGUxNjAzNWYxZjVlMGUyNWE2OTk0MzhiY2UyYWNkYzY5MzA0YmJmYmYzNjM1YjIyY2QwIn0=';
65 $string_fob = 'eyJpdiI6IlBwOXRPL1ZUV1F1SHZpVnpaQkUwSWc9PSIsInZhbHVlIjoiVGFxcTFmSDBvL0hkSldEWkh0elRlaXpkOHJTQW1OeWlDZmMvMndaeXF0SE5YYXd1YjE3MWpPTTZuVEdlSEYzY3VmeXdSbmI5T0d0ZkxXZTRxb3laNWpCdFJxQ2dlQlExemZrRVFFeStxQm40a2VuNWxpUmFpdFoyZjJxMzRLYXBOK0hKa0JvcFlVQklDWE9yR3hEdEVBPT0iLCJtYWMiOiI3NDg5ZDViMjJiNzM3ZjAyZDUxZTAxODVlYjdhYWVmZWFjZDM2ZTE0M2NkNjEwODdjNTJjNmM1NmNlOTUxYjdiIn0='; 74 $string_fob = 'eyJpdiI6IlBwOXRPL1ZUV1F1SHZpVnpaQkUwSWc9PSIsInZhbHVlIjoiVGFxcTFmSDBvL0hkSldEWkh0elRlaXpkOHJTQW1OeWlDZmMvMndaeXF0SE5YYXd1YjE3MWpPTTZuVEdlSEYzY3VmeXdSbmI5T0d0ZkxXZTRxb3laNWpCdFJxQ2dlQlExemZrRVFFeStxQm40a2VuNWxpUmFpdFoyZjJxMzRLYXBOK0hKa0JvcFlVQklDWE9yR3hEdEVBPT0iLCJtYWMiOiI3NDg5ZDViMjJiNzM3ZjAyZDUxZTAxODVlYjdhYWVmZWFjZDM2ZTE0M2NkNjEwODdjNTJjNmM1NmNlOTUxYjdiIn0=';
@@ -29,7 +29,8 @@ class AiCommandController extends BaseController @@ -29,7 +29,8 @@ class AiCommandController extends BaseController
29 $this->map['name|key|ai'] = ['like','%'.$this->map['scene'].'%']; 29 $this->map['name|key|ai'] = ['like','%'.$this->map['scene'].'%'];
30 unset($this->map['scene']); 30 unset($this->map['scene']);
31 } 31 }
32 - $lists = $aiCommandModel->lists($this->map,$this->page,$this->row,$this->order); 32 + $this->order = 'project_id';
  33 + $lists = $aiCommandModel->lists($this->map,$this->page,$this->row,$this->order,['*'],'asc');
33 $projectModel = new Project(); 34 $projectModel = new Project();
34 if(!empty($lists) && !empty($lists['list'])){ 35 if(!empty($lists) && !empty($lists['list'])){
35 foreach ($lists['list'] as $k => $v){ 36 foreach ($lists['list'] as $k => $v){
@@ -177,6 +177,13 @@ class IndexController extends BaseController @@ -177,6 +177,13 @@ class IndexController extends BaseController
177 'text.required' => '文本text不能为空', 177 'text.required' => '文本text不能为空',
178 'lang.required' => '语种不能为空', 178 'lang.required' => '语种不能为空',
179 ]); 179 ]);
  180 + if($this->param['lang'] == 0){
  181 + $lang = Translate::translateSl($this->param['text']);
  182 + $this->param['lang'] = $lang['texts']['sl'] ?? '';
  183 + }
  184 + if(empty($this->param['lang'])){
  185 + $this->fail('未获取到语种');
  186 + }
180 $service = new HumanizeAiTextService(); 187 $service = new HumanizeAiTextService();
181 $data = $service->humanizer($this->param['text'],$this->param['lang']); 188 $data = $service->humanizer($this->param['text'],$this->param['lang']);
182 $this->response('success', Code::SUCCESS, $data); 189 $this->response('success', Code::SUCCESS, $data);
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :DomainApplicantLogController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/29 13:52
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Domain;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Http\Logic\Aside\Domain\DomainApplicantLogLogic;
  15 +use Illuminate\Http\Request;
  16 +
  17 +class DomainApplicantLogController extends BaseController
  18 +{
  19 + public function __construct(Request $request)
  20 + {
  21 + parent::__construct($request);
  22 + $this->logic = new DomainApplicantLogLogic();
  23 + }
  24 +
  25 + /**
  26 + * @remark :获取列表
  27 + * @name :lists
  28 + * @author :lyh
  29 + * @method :post
  30 + * @time :2025/5/29 13:54
  31 + */
  32 + public function lists(){
  33 + $lists = $this->logic->lists($this->map,$this->page,$this->row);
  34 + $this->response('success',Code::SUCCESS,$lists);
  35 + }
  36 +
  37 + /**
  38 + * @remark :保存数据
  39 + * @name :save
  40 + * @author :lyh
  41 + * @method :post
  42 + * @time :2025/5/29 14:19
  43 + */
  44 + public function save(){
  45 + $this->request->validate([
  46 + 'domain'=>'required',
  47 + 'applicant_name'=>'required',
  48 + ],[
  49 + 'domain.required' => 'domain不能为空',
  50 + 'applicant_name.required' => '申请人不能为空',
  51 + ]);
  52 + $data = $this->logic->saveDomainLog();
  53 + $this->response('success',Code::SUCCESS,$data);
  54 + }
  55 +
  56 + /**
  57 + * @remark :删除记录
  58 + * @name :del
  59 + * @author :lyh
  60 + * @method :post
  61 + * @time :2025/5/29 14:25
  62 + */
  63 + public function del(){
  64 + $this->request->validate([
  65 + 'id'=>'required',
  66 + ],[
  67 + 'id.required' => 'domain不能为空',
  68 + ]);
  69 + $data = $this->logic->delDomainLog();
  70 + $this->response('success',Code::SUCCESS,$data);
  71 + }
  72 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :AggregateKeywordAffixController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/27 14:20
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Project;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Http\Logic\Aside\Project\AggregateKeywordAffixLogic;
  15 +use Illuminate\Http\Request;
  16 +
  17 +class AggregateKeywordAffixController extends BaseController
  18 +{
  19 + public function __construct(Request $request)
  20 + {
  21 + parent::__construct($request);
  22 + $this->logic = new AggregateKeywordAffixLogic();
  23 + }
  24 +
  25 + /**
  26 + * @remark :获取当前项目关键字前后缀
  27 + * @name :getAffix
  28 + * @author :lyh
  29 + * @method :post
  30 + * @time :2025/5/27 14:23
  31 + */
  32 + public function getAffix(){
  33 + $this->request->validate([
  34 + 'project_id'=>'required',
  35 + ],[
  36 + 'project_id.required' => 'project_id不能为空',
  37 + ]);
  38 + $data = $this->logic->getAffix();
  39 + $this->response('success',Code::SUCCESS,$data);
  40 + }
  41 +
  42 + /**
  43 + * @remark :保存关键字前后缀
  44 + * @name :save
  45 + * @author :lyh
  46 + * @method :post
  47 + * @time :2025/5/27 14:23
  48 + */
  49 + public function saveAffix(){
  50 + $this->request->validate([
  51 + 'project_id'=>'required',
  52 + 'prefix'=>'required',
  53 + 'suffix'=>'required',
  54 + ],[
  55 + 'project_id.required' => 'project_id不能为空',
  56 + 'prefix.required' => '前缀不能为空',
  57 + 'suffix.required' => '后缀不能为空',
  58 + ]);
  59 + $data = $this->logic->saveAffix();
  60 + $this->response('success',Code::SUCCESS,$data);
  61 + }
  62 +
  63 +}
@@ -9,9 +9,9 @@ @@ -9,9 +9,9 @@
9 9
10 namespace App\Http\Controllers\Bside\News; 10 namespace App\Http\Controllers\Bside\News;
11 11
  12 +use App\Enums\Common\Code;
12 use App\Http\Controllers\Bside\BaseController; 13 use App\Http\Controllers\Bside\BaseController;
13 use App\Http\Logic\Bside\News\NewsExtendLogic; 14 use App\Http\Logic\Bside\News\NewsExtendLogic;
14 -use App\Models\News\NewsExtend;  
15 use Illuminate\Http\Request; 15 use Illuminate\Http\Request;
16 16
17 class NewsExtendController extends BaseController 17 class NewsExtendController extends BaseController
@@ -56,6 +56,25 @@ class NewsExtendController extends BaseController @@ -56,6 +56,25 @@ class NewsExtendController extends BaseController
56 } 56 }
57 57
58 /** 58 /**
  59 + * @remark :修改状态
  60 + * @name :status
  61 + * @author :lyh
  62 + * @method :post
  63 + * @time :2025/5/27 9:22
  64 + */
  65 + public function status(){
  66 + $this->request->validate([
  67 + 'id' => 'required',
  68 + 'status' => 'required',
  69 + ], [
  70 + 'id.required' => '字段名称不能为空',
  71 + 'status.required' => '字段类型不能为空',
  72 + ]);
  73 + $data = $this->logic->extendStatus();
  74 + $this->response('success', Code::SUCCESS, $data);
  75 + }
  76 +
  77 + /**
59 * @remark :删除扩展字段 78 * @remark :删除扩展字段
60 * @name :del 79 * @name :del
61 * @author :lyh 80 * @author :lyh
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :BTemplateModuleRandomController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/27 15:33
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Bside\Template;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Bside\BaseController;
  14 +use App\Http\Logic\Bside\BTemplate\BTemplateModuleRandomLogic;
  15 +use Illuminate\Http\Request;
  16 +
  17 +class BTemplateModuleRandomController extends BaseController
  18 +{
  19 + public function __construct(Request $request)
  20 + {
  21 + parent::__construct($request);
  22 + $this->logic = new BTemplateModuleRandomLogic();
  23 + }
  24 +
  25 + /**
  26 + * @remark :获取当前项目所有随机模块
  27 + * @name :getRandomList
  28 + * @author :lyh
  29 + * @method :post
  30 + * @time :2025/5/27 16:00
  31 + */
  32 + public function getRandomList(){
  33 + $data = $this->logic->getRandomList();
  34 + $this->response('success',Code::SUCCESS,$data);
  35 + }
  36 +
  37 + /**
  38 + * @remark :设置为随机模块
  39 + * @name :saveRandomModule
  40 + * @author :lyh
  41 + * @method :post
  42 + * @time :2025/5/27 15:34
  43 + */
  44 + public function saveRandomModule(){
  45 + $this->request->validate([
  46 + 'module_id'=>'required',
  47 + 'uuid'=>'required',
  48 + 'html'=>'required',
  49 + ],[
  50 + 'module_id.required' => '左侧模块id不能为空',
  51 + 'uuid.required' => 'uuid唯一不能为空',
  52 + 'html.required' => 'html不能为空',
  53 + ]);
  54 + $data = $this->logic->saveRandomModule();
  55 + $this->response('success',Code::SUCCESS,$data);
  56 + }
  57 +
  58 + /**
  59 + * @remark :获取当前随机模块详情
  60 + * @name :getRandomInfo
  61 + * @author :lyh
  62 + * @method :post
  63 + * @time :2025/5/27 15:47
  64 + */
  65 + public function getRandomInfo(){
  66 + $this->request->validate([
  67 + 'uuid'=>'required',
  68 + ],[
  69 + 'uuid.required' => 'uuid唯一不能为空',
  70 + ]);
  71 + $data = $this->logic->getRandomInfo();
  72 + $this->response('success',Code::SUCCESS,$data);
  73 + }
  74 +
  75 + /**
  76 + * @remark :删除随机模块
  77 + * @name :delRandom
  78 + * @author :lyh
  79 + * @method :post
  80 + * @time :2025/5/27 17:59
  81 + */
  82 + public function delRandom(){
  83 + $this->request->validate([
  84 + 'uuid'=>'required',
  85 + ],[
  86 + 'uuid.required' => 'uuid唯一不能为空',
  87 + ]);
  88 + $data = $this->logic->delRandom();
  89 + $this->response('success',Code::SUCCESS,$data);
  90 + }
  91 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :DomainApplicantLogLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/29 13:53
  8 + */
  9 +
  10 +namespace App\Http\Logic\Aside\Domain;
  11 +
  12 +use App\Http\Logic\Aside\BaseLogic;
  13 +use App\Models\Domain\DomainApplicantLog;
  14 +
  15 +class DomainApplicantLogLogic extends BaseLogic
  16 +{
  17 + public function __construct()
  18 + {
  19 + parent::__construct();
  20 + $this->model = new DomainApplicantLog();
  21 + $this->param = $this->requestAll;
  22 + }
  23 +
  24 + /**
  25 + * @remark :列表
  26 + * @name :lists
  27 + * @author :lyh
  28 + * @method :post
  29 + * @time :2025/5/29 14:34
  30 + */
  31 + public function lists($map,$page,$row){
  32 + $lists = $this->model->lists($map,$page,$row,'id',['*']);
  33 + return $this->success($lists);
  34 + }
  35 +
  36 + /**
  37 + * @remark :保存域名申请记录
  38 + * @name :saveDomainLog
  39 + * @author :lyh
  40 + * @method :post
  41 + * @time :2025/5/29 14:34
  42 + */
  43 + public function saveDomainLog(){
  44 + if(isset($this->param['id']) && !empty($this->param['id'])){
  45 + $id = $this->param['id'];
  46 + $this->model->edit($this->param,['id'=>$this->param['id']]);
  47 + }else{
  48 + $id = $this->model->addReturnId($this->param);
  49 + }
  50 + return $this->success(['id'=>$id]);
  51 + }
  52 +
  53 + /**
  54 + * @remark :删除当前记录
  55 + * @name :delDomainLog
  56 + * @author :lyh
  57 + * @method :post
  58 + * @time :2025/5/29 14:40
  59 + */
  60 + public function delDomainLog(){
  61 + $rs = $this->model->del($this->param);
  62 + return $this->success($rs);
  63 + }
  64 +}
@@ -20,7 +20,6 @@ class DomainInfoLogic extends BaseLogic @@ -20,7 +20,6 @@ class DomainInfoLogic extends BaseLogic
20 parent::__construct(); 20 parent::__construct();
21 $this->model = new DomainInfo(); 21 $this->model = new DomainInfo();
22 $this->param = $this->requestAll; 22 $this->param = $this->requestAll;
23 -  
24 } 23 }
25 24
26 /** 25 /**
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :AggregateKeywordAffixLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/27 14:21
  8 + */
  9 +
  10 +namespace App\Http\Logic\Aside\Project;
  11 +
  12 +use App\Http\Logic\Aside\BaseLogic;
  13 +use App\Models\Project\AggregateKeywordAffix;
  14 +
  15 +class AggregateKeywordAffixLogic extends BaseLogic
  16 +{
  17 + public function __construct()
  18 + {
  19 + parent::__construct();
  20 + $this->param = $this->requestAll;
  21 + $this->model = new AggregateKeywordAffix();
  22 + }
  23 +
  24 + /**
  25 + * @remark :保存数据
  26 + * @name :getAffix
  27 + * @author :lyh
  28 + * @method :post
  29 + * @time :2025/5/27 14:25
  30 + */
  31 + public function getAffix(){
  32 + $data = $this->model->read(['project_id'=>$this->param['project_id']]);
  33 + if($data === false){
  34 + $data = [];
  35 + }
  36 + return $this->success($data);
  37 + }
  38 +
  39 + /**
  40 + * @remark :保存数据
  41 + * @name :saveAffix
  42 + * @author :lyh
  43 + * @method :post
  44 + * @time :2025/5/27 14:28
  45 + */
  46 + public function saveAffix(){
  47 + $info = $this->model->read(['project_id'=>$this->param['project_id']]);
  48 + try {
  49 + if($info === false){
  50 + $this->model->addReturnId(['project_id'=>$this->param['project_id'],'prefix'=>$this->param['prefix'] ?? '','suffix'=>$this->param['suffix'] ?? '']);
  51 + }else{
  52 + $this->model->edit(['prefix'=>$this->param['prefix'] ?? '','suffix'=>$this->param['suffix'] ?? ''],['project_id'=>$this->param['project_id']]);
  53 + }
  54 + }catch (\Exception $e){
  55 + $this->fail('保存失败,请联系管理员');
  56 + }
  57 + return $this->success();
  58 + }
  59 +}
@@ -139,11 +139,14 @@ class AiBlogLogic extends BaseLogic @@ -139,11 +139,14 @@ class AiBlogLogic extends BaseLogic
139 try { 139 try {
140 $aiSettingInfo = $this->getProjectAiSetting(); 140 $aiSettingInfo = $this->getProjectAiSetting();
141 $aiBlogService = new AiBlogService(); 141 $aiBlogService = new AiBlogService();
  142 + $aiBlogTask = new AiBlogTask();
142 foreach ($this->param['ids'] as $id) { 143 foreach ($this->param['ids'] as $id) {
143 - $info = $this->model->read(['id'=>$id],['task_id','route']); 144 + $info = $this->model->read(['id'=>$id],['task_id','route','author_id']);
144 $aiBlogService->mch_id = $aiSettingInfo['mch_id']; 145 $aiBlogService->mch_id = $aiSettingInfo['mch_id'];
145 $aiBlogService->key = $aiSettingInfo['key']; 146 $aiBlogService->key = $aiSettingInfo['key'];
146 $aiBlogService->delDetail($info['task_id']); 147 $aiBlogService->delDetail($info['task_id']);
  148 + //重新生成作者页面
  149 + $aiBlogTask->addReturnId(['type'=>$aiBlogTask::TYPE_AUTHOR_ID,'task_id'=>$info['author_id'],'status'=>1,'project_id'=>$this->user['project_id']]);
147 //删除路由映射 150 //删除路由映射
148 RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']); 151 RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']);
149 $this->model->del(['id'=>$id]); 152 $this->model->del(['id'=>$id]);
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :BTemplateModuleRandomLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/27 15:36
  8 + */
  9 +
  10 +namespace App\Http\Logic\Bside\BTemplate;
  11 +
  12 +use App\Http\Logic\Bside\BaseLogic;
  13 +use App\Models\Template\TemplateModuleRandom;
  14 +
  15 +class BTemplateModuleRandomLogic extends BaseLogic
  16 +{
  17 + public function __construct()
  18 + {
  19 + parent::__construct();
  20 + $this->model = new TemplateModuleRandom();
  21 + $this->param = $this->requestAll;
  22 + }
  23 +
  24 + /**
  25 + * @remark :保存为随机模块
  26 + * @name :saveRandomModule
  27 + * @author :lyh
  28 + * @method :post
  29 + * @time :2025/5/27 15:38
  30 + */
  31 + public function saveRandomModule(){
  32 + //查询当前uuid是否已存在
  33 + $info = $this->model->read(['project_id'=>$this->user['project_id'],'uuid'=>$this->param['uuid'],'module_id'=>$this->param['module_id']]);
  34 + try {
  35 + if($info === false){
  36 + $this->param['project_id'] = $this->user['project_id'];
  37 + //执行新增数据
  38 + $this->model->add($this->param);
  39 + }else{
  40 + //执行编辑
  41 + $this->model->edit(['html'=>$this->param['html']],['id'=>$this->param['id']]);
  42 + }
  43 + }catch (\Exception $e){
  44 + $this->fail('保存失败,请联系管理员');
  45 + }
  46 + return $this->success();
  47 + }
  48 +
  49 + /**
  50 + * @remark :获取当前项目的所有随机模块
  51 + * @name :getRandomList
  52 + * @author :lyh
  53 + * @method :post
  54 + * @time :2025/5/27 15:59
  55 + */
  56 + public function getRandomList(){
  57 + $data = $this->model->list(['project_id'=>$this->user['project_id']],'id',['id','uuid','project_id','module_id']);
  58 + return $this->success($data);
  59 + }
  60 +
  61 + /**
  62 + * @remark :获取当前模块是否为随机模块
  63 + * @name :getIsRandomModule
  64 + * @author :lyh
  65 + * @method :post
  66 + * @time :2025/5/27 15:47
  67 + */
  68 + public function getRandomInfo(){
  69 + $info = $this->model->read(['uuid'=>$this->param['uuid']]);
  70 + if($info === false){
  71 + $info = [];
  72 + }
  73 + return $this->success($info);
  74 + }
  75 +
  76 + /**
  77 + * @remark :删除数据
  78 + * @name :delRandom
  79 + * @author :lyh
  80 + * @method :post
  81 + * @time :2025/5/27 18:04
  82 + */
  83 + public function delRandom(){
  84 + $res = $this->model->del(['uuid'=>$this->param['uuid']]);
  85 + return $this->success($res);
  86 + }
  87 +}
@@ -49,10 +49,16 @@ class CustomTemplateLogic extends BaseLogic @@ -49,10 +49,16 @@ class CustomTemplateLogic extends BaseLogic
49 if($info === false){ 49 if($info === false){
50 $this->fail('当前数据不存在'); 50 $this->fail('当前数据不存在');
51 } 51 }
  52 + if(!empty($info['html'])){
  53 + $info['is_renovation'] = 1;
  54 + }else{
  55 + $info['html'] = $info['text'];
  56 + $info['is_renovation'] = 0;
  57 + }
52 $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']); 58 $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']);
53 if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){ 59 if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){
54 $template_id = $this->getTemplateId(); 60 $template_id = $this->getTemplateId();
55 - $html = $this->getTemplateComHtml(empty($info['html']) ? $info['text'] : $info['html'],$info['html_style'],$template_id); 61 + $html = $this->getTemplateComHtml($info['html'],$info['html_style'],$template_id);
56 $info['html'] = $this->getHeadFooter($html); 62 $info['html'] = $this->getHeadFooter($html);
57 } 63 }
58 return $this->success($info); 64 return $this->success($info);
@@ -25,7 +25,7 @@ class MonthCountLogic extends BaseLogic @@ -25,7 +25,7 @@ class MonthCountLogic extends BaseLogic
25 */ 25 */
26 public function getCountLists($map,$order = 'created_at',$filed = ['*']){ 26 public function getCountLists($map,$order = 'created_at',$filed = ['*']){
27 $map['project_id'] = $this->user['project_id']; 27 $map['project_id'] = $this->user['project_id'];
28 - $lists = $this->model->list($map,$order,$filed,'desc',12); 28 + $lists = $this->model->list($map,$order,$filed,'desc');
29 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){ 29 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
30 foreach ($lists as $k => $v){ 30 foreach ($lists as $k => $v){
31 if(empty($v['source_country'])){ 31 if(empty($v['source_country'])){
@@ -55,9 +55,9 @@ class MonthCountLogic extends BaseLogic @@ -55,9 +55,9 @@ class MonthCountLogic extends BaseLogic
55 */ 55 */
56 public function getIpPvCount(){ 56 public function getIpPvCount(){
57 $count = new Count(); 57 $count = new Count();
58 - $startTime = date("Y-m-d", strtotime("-11 months", mktime(0, 0, 0))); 58 + $startTime = date("Y-m-d", strtotime("-35 months", mktime(0, 0, 0)));
59 $ensTime = date('Y-m-d',time()); 59 $ensTime = date('Y-m-d',time());
60 - $lists = $count->list(['date'=>['between',[$startTime,$ensTime]],'project_id'=>$this->user['project_id']],'id',['*'],'asc'); 60 + $lists = $count->list(['date'=>['<=',$ensTime],'project_id'=>$this->user['project_id']],'id',['*'],'asc');
61 $groupedData = []; 61 $groupedData = [];
62 foreach ($lists as $v){ 62 foreach ($lists as $v){
63 $month = date('Y-m', strtotime($v['date'])); 63 $month = date('Y-m', strtotime($v['date']));
@@ -30,6 +30,7 @@ class NewsExtendLogic extends BaseLogic @@ -30,6 +30,7 @@ class NewsExtendLogic extends BaseLogic
30 * @time :2025/5/26 15:17 30 * @time :2025/5/26 15:17
31 */ 31 */
32 public function list($map){ 32 public function list($map){
  33 + $map['status'] = 1;
33 $data = $this->model->list($map); 34 $data = $this->model->list($map);
34 return $this->success($data); 35 return $this->success($data);
35 } 36 }
@@ -61,6 +62,18 @@ class NewsExtendLogic extends BaseLogic @@ -61,6 +62,18 @@ class NewsExtendLogic extends BaseLogic
61 } 62 }
62 63
63 /** 64 /**
  65 + * @remark :修改状态
  66 + * @name :extendStatus
  67 + * @author :lyh
  68 + * @method :post
  69 + * @time :2025/5/27 9:20
  70 + */
  71 + public function extendStatus(){
  72 + $result = $this->model->edit(['status'=>$this->param['status']],['id'=>$this->param['id']]);
  73 + return $this->success(['result'=>$result]);
  74 + }
  75 +
  76 + /**
64 * @remark :删除字段 77 * @remark :删除字段
65 * @name :extendDel 78 * @name :extendDel
66 * @author :lyh 79 * @author :lyh
@@ -8,6 +8,8 @@ use App\Http\Logic\Bside\BaseLogic; @@ -8,6 +8,8 @@ use App\Http\Logic\Bside\BaseLogic;
8 use App\Models\News\News; 8 use App\Models\News\News;
9 use App\Models\News\NewsCategory; 9 use App\Models\News\NewsCategory;
10 use App\Models\News\NewsCategory as NewsCategoryModel; 10 use App\Models\News\NewsCategory as NewsCategoryModel;
  11 +use App\Models\News\NewsExtend;
  12 +use App\Models\News\NewsExtendInfo;
11 use App\Models\RouteMap\RouteMap; 13 use App\Models\RouteMap\RouteMap;
12 use App\Models\Template\BTemplate; 14 use App\Models\Template\BTemplate;
13 use App\Services\CosService; 15 use App\Services\CosService;
@@ -79,6 +81,7 @@ class NewsLogic extends BaseLogic @@ -79,6 +81,7 @@ class NewsLogic extends BaseLogic
79 $this->edit(['url' => $route], ['id' => $id]); 81 $this->edit(['url' => $route], ['id' => $id]);
80 $this->curlDelRoute(['new_route'=>$route]); 82 $this->curlDelRoute(['new_route'=>$route]);
81 } 83 }
  84 + $this->model->saveExtendInfo($id,$this->param['extend'] ?? []);
82 $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); 85 $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
83 return $this->success(['id'=>$id]); 86 return $this->success(['id'=>$id]);
84 } 87 }
@@ -143,11 +146,12 @@ class NewsLogic extends BaseLogic @@ -143,11 +146,12 @@ class NewsLogic extends BaseLogic
143 { 146 {
144 $info = $this->model->read($this->param); 147 $info = $this->model->read($this->param);
145 if($info === false){ 148 if($info === false){
146 - $this->fail('error'); 149 + $this->fail('当前数据不存在');
147 } 150 }
148 $info['category_id'] = explode(',',trim($info['category_id'],',')); 151 $info['category_id'] = explode(',',trim($info['category_id'],','));
149 $info['image_link'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']); 152 $info['image_link'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']);
150 $info['og_image'] = getImageUrl(empty($info['og_image']) ? $info['image'] : $info['og_image'],$this->user['storage_type'],$this->user['project_location']); 153 $info['og_image'] = getImageUrl(empty($info['og_image']) ? $info['image'] : $info['og_image'],$this->user['storage_type'],$this->user['project_location']);
  154 + $info['extend'] = $this->model->getExtendInfo($info['id']);
151 return $this->success($info); 155 return $this->success($info);
152 } 156 }
153 157
@@ -215,6 +215,10 @@ class RankDataLogic extends BaseLogic @@ -215,6 +215,10 @@ class RankDataLogic extends BaseLogic
215 $page = intval($this->request['page'] ?: 1); 215 $page = intval($this->request['page'] ?: 1);
216 $lang = $this->request['lang'] ?: ''; 216 $lang = $this->request['lang'] ?: '';
217 $project_id = $this->user['project_id']; 217 $project_id = $this->user['project_id'];
  218 + # fixme 白帽演示项目或者演示项目排名信息数据
  219 + if ($project_id == 3989) {
  220 + $project_id = 1;
  221 + }
218 $project = (new ProjectLogic())->getProjectInfo($project_id); 222 $project = (new ProjectLogic())->getProjectInfo($project_id);
219 if(request('api_no')){ 223 if(request('api_no')){
220 $api_no = request('api_no'); 224 $api_no = request('api_no');
@@ -286,8 +290,8 @@ class RankDataLogic extends BaseLogic @@ -286,8 +290,8 @@ class RankDataLogic extends BaseLogic
286 $v = [ 290 $v = [
287 'keyword' => $key, 291 'keyword' => $key,
288 'domain_type' => $domain_arr[0], 292 'domain_type' => $domain_arr[0],
289 - 'domain' => $domain_arr[1],  
290 - 'domain_text' => $domain_text, 293 + 'domain' => $this->user['project_id'] == 3989 ? 'google.com' : $domain_arr[1], # fixme 白帽演示项目或者演示项目排名信息数据
  294 + 'domain_text' => $this->user['project_id'] == 3989 ? 'google.com' : $domain_text, # fixme 白帽演示项目或者演示项目排名信息数据
291 'g' => $last['g'], //1核心关键词 295 'g' => $last['g'], //1核心关键词
292 'position' => $data, 296 'position' => $data,
293 ]; 297 ];
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :DomainApplicantLog.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/29 13:47
  8 + */
  9 +
  10 +namespace App\Models\Domain;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +class DomainApplicantLog extends Base
  15 +{
  16 + protected $table = 'gl_domain_applicant_log';
  17 +}
@@ -32,4 +32,124 @@ class News extends Base @@ -32,4 +32,124 @@ class News extends Base
32 public function getRelatedProductIdAttribute($value){ 32 public function getRelatedProductIdAttribute($value){
33 return Arr::setToArr($value); 33 return Arr::setToArr($value);
34 } 34 }
  35 +
  36 + /**
  37 + * @remark :扩展字段根据type返回类型
  38 + * @name :setTypValues
  39 + * @author :lyh
  40 + * @method :post
  41 + * @time :2023/12/6 14:43
  42 + */
  43 + public function getExtendInfo($news_id){
  44 + $extendModel = new NewsExtend();
  45 + $list = $extendModel->list(['status'=>1],'id',['id','type','key','title']);
  46 + if(empty($list)){
  47 + return [];
  48 + }
  49 + $extendInfoModel = new NewsExtendInfo();
  50 + $infoList = $extendInfoModel->list(['news_id'=>$news_id],'created_at');
  51 + foreach ($list as $k=>$v){
  52 + if($v['type'] == 3 || $v['type'] == 4){
  53 + $v['values'] = [];
  54 + }else{
  55 + $v['values'] = '';
  56 + }
  57 + if(!empty($infoList)){
  58 + foreach ($infoList as $values){
  59 + if($v['key'] == $values['key']){
  60 + $v = $this->setTypValues($v,$values);
  61 + break;
  62 + }
  63 + }
  64 + }
  65 + $list[$k] = $v;
  66 + }
  67 + return $list;
  68 + }
  69 +
  70 +
  71 + /**
  72 + * @remark :扩展字段根据type返回类型
  73 + * @name :setTypValues
  74 + * @author :lyh
  75 + * @method :post
  76 + * @time :2023/12/6 14:43
  77 + */
  78 + public function setTypValues($v,$info){
  79 + if($v['type'] == 3){
  80 + $arr = json_decode($info['values']);
  81 + foreach ($arr as $k1=>$v1){
  82 + $v1 = (array)$v1;
  83 + $v1['url'] = getImageUrl($v1['url'],$this->user['storage_type'],$this->user['project_location']);
  84 + $arr[$k1] = $v1;
  85 + }
  86 + $v['values'] = $arr;
  87 + }elseif($v['type'] == 4){
  88 + $arr1 = json_decode($info['values']);
  89 + foreach ($arr1 as $k1=>$v1){
  90 + $v1 = (array)$v1;
  91 + if(isset($v1['url'])){
  92 + $v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0);
  93 + }else{
  94 + $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0);
  95 + }
  96 + $arr1[$k1] = $v1;
  97 + }
  98 + $v['values'] = $arr1;
  99 + }else{
  100 + $v['values'] = $info['values'];
  101 + }
  102 + return $v;
  103 + }
  104 +
  105 + /**
  106 + * @remark :保存扩展字段
  107 + * @name :saveExtend
  108 + * @author :lyh
  109 + * @method :post
  110 + * @time :2023/11/9 15:02
  111 + */
  112 + public function saveExtendInfo($news_id,$extend){
  113 + //先删除以前的数据
  114 + $extendInfoModel = new NewsExtendInfo();
  115 + $extendInfoModel->del(['news_id'=>$news_id]);
  116 + if(empty($extend)) {
  117 + return true;
  118 + }
  119 + foreach ($extend as $k => $v){
  120 + if(empty($v['values'])){
  121 + continue;
  122 + }
  123 + $v = $this->saveHandleExtend($v,$news_id);
  124 + $extendInfoModel->add($v);
  125 + }
  126 + return true;
  127 + }
  128 +
  129 + /**
  130 + * @remark :保存扩展字段时处理数据
  131 + * @name :saveHandleExtend
  132 + * @author :lyh
  133 + * @method :post
  134 + * @time :2023/12/6 15:11
  135 + */
  136 + public function saveHandleExtend(&$v,$news_id){
  137 + unset($v['title']);
  138 + if($v['type'] == 3){
  139 + foreach ($v['values'] as $k1=>$v1){
  140 + $v1['url'] = str_replace_url($v1['url']);
  141 + $v['values'][$k1] = $v1;
  142 + }
  143 + $v['values'] = json_encode($v['values']);
  144 + }elseif ($v['type'] == 4){
  145 + foreach ($v['values'] as $k1=>$v1){
  146 + $v1['url'] = str_replace_url($v1['url']);
  147 + $v['values'][$k1] = $v1;
  148 + }
  149 + $v['values'] = json_encode($v['values']);
  150 + }
  151 + $v['project_id'] = $this->user['project_id'];
  152 + $v['news_id'] = $news_id;
  153 + return $v;
  154 + }
35 } 155 }
@@ -26,7 +26,7 @@ class NewsExtend extends Base @@ -26,7 +26,7 @@ class NewsExtend extends Base
26 * @time :2025/5/26 15:39 26 * @time :2025/5/26 15:39
27 */ 27 */
28 public function getKey($key = self::EXTEND_KEY,$i = 1){ 28 public function getKey($key = self::EXTEND_KEY,$i = 1){
29 - $info = $this->model->read(['key'=>$key.$i]); 29 + $info = $this->read(['key'=>$key.$i]);
30 if($info !== false){ 30 if($info !== false){
31 return $this->getKey($key,$i+1); 31 return $this->getKey($key,$i+1);
32 }else{ 32 }else{
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :AggregateKeywordAffix.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/27 14:16
  8 + */
  9 +
  10 +namespace App\Models\Project;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :聚合页关键字前后缀
  16 + * @name :AggregateKeywordAffix
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/5/27 14:16
  20 + */
  21 +class AggregateKeywordAffix extends Base
  22 +{
  23 + protected $table = 'gl_aggregate_keyword_affix';
  24 +}
@@ -58,7 +58,8 @@ class Project extends Base @@ -58,7 +58,8 @@ class Project extends Base
58 3 => '告知书一', 58 3 => '告知书一',
59 4 => '告知书二', 59 4 => '告知书二',
60 5 => 'Q告知书二', 60 5 => 'Q告知书二',
61 - 6 => 'CKA', 61 + 6 => 'KA',
  62 + 7 => 'CKA',
62 ]; 63 ];
63 } 64 }
64 65
@@ -105,6 +106,10 @@ class Project extends Base @@ -105,6 +106,10 @@ class Project extends Base
105 ]; 106 ];
106 } 107 }
107 108
  109 + /**
  110 + * 项目版本
  111 + * @return array
  112 + */
108 public static function planMap() 113 public static function planMap()
109 { 114 {
110 return [ 115 return [
@@ -122,6 +127,9 @@ class Project extends Base @@ -122,6 +127,9 @@ class Project extends Base
122 12 => '俄语商务版', 127 12 => '俄语商务版',
123 14 => '俄语旗舰版', 128 14 => '俄语旗舰版',
124 13 => '体验版', 129 13 => '体验版',
  130 + 15 => 'CKA方案半托管',
  131 + 16 => 'CKA方案全托管',
  132 + 17 => '多语言版',
125 ]; 133 ];
126 } 134 }
127 135
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TemplateModuleRandom.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/5/27 15:31
  8 + */
  9 +
  10 +namespace App\Models\Template;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :随机模块
  16 + * @name :TemplateModuleRandom
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/5/27 15:32
  20 + */
  21 +class TemplateModuleRandom extends Base
  22 +{
  23 + protected $table = 'gl_public_template_module_random';
  24 +}
@@ -49,7 +49,13 @@ class AiCommandService @@ -49,7 +49,13 @@ class AiCommandService
49 "Content-Type:application/json;charset=utf-8", 49 "Content-Type:application/json;charset=utf-8",
50 ); 50 );
51 $result = http_post($this->url,json_encode($param,true),$header); 51 $result = http_post($this->url,json_encode($param,true),$header);
52 - return $result; 52 + $data = $result['content'][0]['data'] ?? '';
  53 + $data = trim($data, "\"\n");
  54 + $data = preg_replace('/^```html\s*/', '', $data); // 去除开头
  55 + $data = preg_replace('/\s*```$/', '', $data); // 去除结尾
  56 + $data = str_replace("\\n", "\n", $data);
  57 + $data = str_replace('\"', '"', $data);
  58 + return ['data'=>$data];
53 } 59 }
54 60
55 } 61 }
@@ -189,7 +189,7 @@ class ProjectAssociationServices extends BaseService @@ -189,7 +189,7 @@ class ProjectAssociationServices extends BaseService
189 ]; 189 ];
190 $param['sign'] = $this->getSign($param); 190 $param['sign'] = $this->getSign($param);
191 $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg'; 191 $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg';
192 - $result = Http::withoutVerifying()->post($url, $param)->json(); 192 + $result = Http::withoutVerifying()->timeout(30)->post($url, $param)->json();
193 if(empty($result) || $result['status'] != 200){ 193 if(empty($result) || $result['status'] != 200){
194 throw new \Exception($result['message'] ?? ''); 194 throw new \Exception($result['message'] ?? '');
195 } 195 }
@@ -220,6 +220,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -220,6 +220,7 @@ Route::middleware(['aloginauth'])->group(function () {
220 Route::any('/', [Aside\Project\MinorLanguagesController::class, 'getMinorLanguageList'])->name('admin.getMinorLanguageList'); 220 Route::any('/', [Aside\Project\MinorLanguagesController::class, 'getMinorLanguageList'])->name('admin.getMinorLanguageList');
221 Route::any('/getLanguages', [Aside\Project\MinorLanguagesController::class, 'getLanguages'])->name('admin.getLanguages'); 221 Route::any('/getLanguages', [Aside\Project\MinorLanguagesController::class, 'getLanguages'])->name('admin.getLanguages');
222 }); 222 });
  223 +
223 //更新项目tdk 224 //更新项目tdk
224 Route::any('/updateSeoTdk', [Aside\Com\UpdateController::class, 'updateSeoTdk'])->name('admin.project_updateSeoTdk'); 225 Route::any('/updateSeoTdk', [Aside\Com\UpdateController::class, 'updateSeoTdk'])->name('admin.project_updateSeoTdk');
225 //项目内容采集 226 //项目内容采集
@@ -268,6 +269,11 @@ Route::middleware(['aloginauth'])->group(function () { @@ -268,6 +269,11 @@ Route::middleware(['aloginauth'])->group(function () {
268 Route::any('/getCountryCode', [Aside\Domain\DomainInfoController::class, 'getCountryCode'])->name('admin.get_country_code'); 269 Route::any('/getCountryCode', [Aside\Domain\DomainInfoController::class, 'getCountryCode'])->name('admin.get_country_code');
269 270
270 }); 271 });
  272 + Route::prefix('domain_log')->group(function () {
  273 + Route::any('/', [Aside\Domain\DomainApplicantLogController::class, 'lists'])->name('admin.domain_log_lists');
  274 + Route::any('/save', [Aside\Domain\DomainApplicantLogController::class, 'save'])->name('admin.domain_log_save');
  275 + Route::any('/del', [Aside\Domain\DomainApplicantLogController::class, 'del'])->name('admin.domain_log_del');
  276 + });
271 //图片操作 277 //图片操作
272 Route::prefix('images')->group(function () { 278 Route::prefix('images')->group(function () {
273 Route::post('/upload', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('images_upload'); 279 Route::post('/upload', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('images_upload');
@@ -562,6 +568,11 @@ Route::middleware(['aloginauth'])->group(function () { @@ -562,6 +568,11 @@ Route::middleware(['aloginauth'])->group(function () {
562 Route::any('/info', [Aside\Project\AggregateKeywordController::class, 'info'])->name('admin.aggregateKeyword_info'); 568 Route::any('/info', [Aside\Project\AggregateKeywordController::class, 'info'])->name('admin.aggregateKeyword_info');
563 Route::any('/save', [Aside\Project\AggregateKeywordController::class, 'save'])->name('admin.aggregateKeyword_save'); 569 Route::any('/save', [Aside\Project\AggregateKeywordController::class, 'save'])->name('admin.aggregateKeyword_save');
564 Route::any('/del', [Aside\Project\AggregateKeywordController::class, 'del'])->name('admin.aggregateKeyword_del'); 570 Route::any('/del', [Aside\Project\AggregateKeywordController::class, 'del'])->name('admin.aggregateKeyword_del');
  571 + //聚合页关键词前后缀
  572 + Route::prefix('affix')->group(function () {
  573 + Route::any('/getAffix', [Aside\Project\AggregateKeywordAffixController::class, 'getAffix'])->name('admin.affix_getAffix');
  574 + Route::any('/saveAffix', [Aside\Project\AggregateKeywordAffixController::class, 'saveAffix'])->name('admin.affix_saveAffix');
  575 + });
565 }); 576 });
566 577
567 }); 578 });
@@ -104,6 +104,11 @@ Route::middleware(['bloginauth'])->group(function () { @@ -104,6 +104,11 @@ Route::middleware(['bloginauth'])->group(function () {
104 Route::any('/category/status', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'status'])->name('news_category_status'); 104 Route::any('/category/status', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'status'])->name('news_category_status');
105 Route::any('/category/sort', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'sort'])->name('news_category_sort'); 105 Route::any('/category/sort', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'sort'])->name('news_category_sort');
106 Route::any('/category/categoryTopList', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'categoryTopList'])->name('news_category_categoryTopList'); 106 Route::any('/category/categoryTopList', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'categoryTopList'])->name('news_category_categoryTopList');
  107 + //新闻扩展模块
  108 + Route::any('/extend/', [\App\Http\Controllers\Bside\News\NewsExtendController::class, 'lists'])->name('news_extend_lists');
  109 + Route::any('/extend/save', [\App\Http\Controllers\Bside\News\NewsExtendController::class, 'save'])->name('news_extend_save');
  110 + Route::any('/extend/status', [\App\Http\Controllers\Bside\News\NewsExtendController::class, 'status'])->name('news_extend_status');
  111 + Route::any('/extend/del', [\App\Http\Controllers\Bside\News\NewsExtendController::class, 'del'])->name('news_extend_del');
107 }); 112 });
108 113
109 //博客相关路由 114 //博客相关路由
@@ -438,7 +443,14 @@ Route::middleware(['bloginauth'])->group(function () { @@ -438,7 +443,14 @@ Route::middleware(['bloginauth'])->group(function () {
438 Route::any('/save', [\App\Http\Controllers\Bside\Template\BTemplateModuleProjectController::class, 'save'])->name('template_module_project_save'); 443 Route::any('/save', [\App\Http\Controllers\Bside\Template\BTemplateModuleProjectController::class, 'save'])->name('template_module_project_save');
439 Route::any('/del', [\App\Http\Controllers\Bside\Template\BTemplateModuleProjectController::class, 'del'])->name('template_module_project_del'); 444 Route::any('/del', [\App\Http\Controllers\Bside\Template\BTemplateModuleProjectController::class, 'del'])->name('template_module_project_del');
440 }); 445 });
441 - 446 + //随机模块
  447 + Route::prefix('random')->group(function () {
  448 + //获取所有左侧模版
  449 + Route::any('/getRandomList', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'getRandomList'])->name('template_random_getRandomList');
  450 + Route::any('/getRandomInfo', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'getRandomInfo'])->name('template_random_getRandomInfo');
  451 + Route::any('/saveRandomModule', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'saveRandomModule'])->name('template_random_saveRandomModule');
  452 + Route::any('/delRandom', [\App\Http\Controllers\Bside\Template\BTemplateModuleRandomController::class, 'delRandom'])->name('template_random_delRandom');
  453 + });
442 //编辑记录 454 //编辑记录
443 Route::prefix('log')->group(function () { 455 Route::prefix('log')->group(function () {
444 //获取所有左侧模版 456 //获取所有左侧模版