作者 lyh

gx生成评论

@@ -43,7 +43,7 @@ class InitKeywordComment extends Command @@ -43,7 +43,7 @@ class InitKeywordComment extends Command
43 $this->_action($val['id']); 43 $this->_action($val['id']);
44 } 44 }
45 return true; 45 return true;
46 - $keywordCommonModel = new AggregateKeywordComment(); 46 + $keywordCommentModel = new AggregateKeywordComment();
47 while (true){ 47 while (true){
48 $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_KEYWORD_COMMON)->where('status', NoticeLog::STATUS_PENDING)->get(); 48 $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_KEYWORD_COMMON)->where('status', NoticeLog::STATUS_PENDING)->get();
49 if(empty($list)){ 49 if(empty($list)){
@@ -56,7 +56,7 @@ class InitKeywordComment extends Command @@ -56,7 +56,7 @@ class InitKeywordComment extends Command
56 echo date('Y-m-d H:i:s').'执行的项目id:' . $project_id . PHP_EOL; 56 echo date('Y-m-d H:i:s').'执行的项目id:' . $project_id . PHP_EOL;
57 try { 57 try {
58 $this->_action($project_id); 58 $this->_action($project_id);
59 - $count = $keywordCommonModel->counts(['project_id'=>$project_id]); 59 + $count = $keywordCommentModel->counts(['project_id'=>$project_id]);
60 if($count > 100){ 60 if($count > 100){
61 $item->status = NoticeLog::STATUS_SUCCESS; 61 $item->status = NoticeLog::STATUS_SUCCESS;
62 $item->save(); 62 $item->save();
@@ -107,8 +107,8 @@ class InitKeywordComment extends Command @@ -107,8 +107,8 @@ class InitKeywordComment extends Command
107 'updated_at'=>date('Y-m-d H:i:s') 107 'updated_at'=>date('Y-m-d H:i:s')
108 ]; 108 ];
109 } 109 }
110 - $keywordCommonModel = new AggregateKeywordComment();  
111 - $keywordCommonModel->insertAll($data); 110 + $keywordCommentModel = new AggregateKeywordComment();
  111 + $keywordCommentModel->insertAll($data);
112 } 112 }
113 return true; 113 return true;
114 } 114 }
@@ -43,69 +43,6 @@ use Illuminate\Support\Facades\DB; @@ -43,69 +43,6 @@ use Illuminate\Support\Facades\DB;
43 class CNoticeController extends BaseController 43 class CNoticeController extends BaseController
44 { 44 {
45 /** 45 /**
46 - * @remark :计算页面数量  
47 - * @name :countLanguagePage  
48 - * @author :lyh  
49 - * @method :post  
50 - * @time :2025/6/19 17:14  
51 - */  
52 - public function countLanguagePage(){  
53 - $this->request->validate([  
54 - 'language'=>'required',  
55 - 'project_id'=>'required',  
56 - ],[  
57 - 'language.required' => 'language不能为空',  
58 - 'project_id.required' => 'project_id不能为空',  
59 - ]);  
60 - $bigProjectModel = new TranslateBigProject();  
61 - $project_id_arr = $bigProjectModel->selectField(['status'=>1],'project_id') ?? [];  
62 - if(in_array($this->param['project_id'],$project_id_arr)){  
63 - $this->response('success');  
64 - }  
65 - $lang_num = count($this->param['language']);  
66 - ProjectServer::useProject($this->param['project_id']);  
67 - $keyword_num = (new Keyword())->counts(['route'=>['!=',null]]);  
68 - $data_num = $this->productNum() + $this->customNum() + $this->newsNum() + $this->blogNum();  
69 - DB::disconnect('custom_mysql');  
70 - $number = $keyword_num * 18 + $lang_num * $data_num;  
71 - if($number >= 450000){  
72 - $this->response('success',Code::SUCCESS,['msg'=>'翻译数量过多, 大概页面数量:'.$number.', 磁盘空间占用可能会超过40G,请联系管理员操作!']);  
73 - }  
74 - $this->response('success');  
75 - }  
76 -  
77 - /**  
78 - * @remark :产品分类页面数量  
79 - * @name :productCateNum  
80 - * @author :lyh  
81 - * @method :post  
82 - * @time :2025/1/4 10:43  
83 - */  
84 - public function productNum(){  
85 - $number = (new Product())->counts(['status'=>1]);  
86 - $settingModel = new SettingNum();  
87 - $info = $settingModel->read(['type'=>1]);  
88 - if($info === false){  
89 - $product_page_number = 15;  
90 - }else{  
91 - $product_page_number = $info['num'];  
92 - }  
93 - $productCateModel = new Category();  
94 - $productCateList = $productCateModel->list(['status'=>1]);  
95 - if(!empty($productCateList)){  
96 - $cateReModel = new CategoryRelated();  
97 - foreach ($productCateList as $v){  
98 - $cate_num = $cateReModel->counts(['cate_id'=>$v['id']]);  
99 - if($cate_num == 0){  
100 - $number += 1;  
101 - }else{  
102 - $number += ceil($cate_num / $product_page_number);  
103 - }  
104 - }  
105 - }  
106 - return $number;  
107 - }  
108 - /**  
109 * 更新通知C端 46 * 更新通知C端
110 * @param Request $request 47 * @param Request $request
111 * @return \Illuminate\Http\JsonResponse 48 * @return \Illuminate\Http\JsonResponse
@@ -134,102 +71,8 @@ class CNoticeController extends BaseController @@ -134,102 +71,8 @@ class CNoticeController extends BaseController
134 http_post($url, json_encode($param)); 71 http_post($url, json_encode($param));
135 $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!'); 72 $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
136 } 73 }
137 - /**  
138 - * @remark :新闻数量  
139 - * @name :newsNum  
140 - * @author :lyh  
141 - * @method :post  
142 - * @time :2025/1/4 11:21  
143 - */  
144 - public function newsNum(){  
145 - $newsModel = new News();  
146 - $number = $newsModel->counts(['status'=>1]);  
147 - $settingModel = new SettingNum();  
148 - $info = $settingModel->read(['type'=>2]);  
149 - if($info === false){  
150 - $news_page_number = 10;  
151 - }else{  
152 - $news_page_number = $info['num'];  
153 - }  
154 - $newsCateModel = new NewsCategory();  
155 - $newsCateList = $newsCateModel->list(['status'=>0]);  
156 - if(!empty($newsCateList)){  
157 - foreach ($newsCateList as $v){  
158 - $cate_num = $newsModel->counts(['category_id'=>['like',','.$v['id'].',']]);  
159 - if($cate_num == 0){  
160 - $number += 1;  
161 - }else{  
162 - $number += ceil($cate_num / $news_page_number);  
163 - }  
164 - }  
165 - }  
166 - return $number;  
167 - }  
168 -  
169 - /**  
170 - * @remark :博客数量  
171 - * @name :blogNum  
172 - * @author :lyh  
173 - * @method :post  
174 - * @time :2025/1/4 11:21  
175 - */  
176 - public function blogNum(){  
177 - $blogModel = new Blog();  
178 - $number = $blogModel->counts(['status'=>1]);  
179 - $settingModel = new SettingNum();  
180 - $info = $settingModel->read(['type'=>3]);  
181 - if($info === false){  
182 - $news_page_number = 10;  
183 - }else{  
184 - $news_page_number = $info['num'];  
185 - }  
186 - $blogCateModel = new BlogCategory();  
187 - $blogCateList = $blogCateModel->list(['status'=>0]);  
188 - if(!empty($blogCateList)){  
189 - foreach ($blogCateList as $v){  
190 - $cate_num = $blogModel->counts(['category_id'=>['like',','.$v['id'].',']]);  
191 - if($cate_num == 0){  
192 - $number += 1;  
193 - }else{  
194 - $number += ceil($cate_num / $news_page_number);  
195 - }  
196 - }  
197 - }  
198 - return $number;  
199 - }  
200 74
201 /** 75 /**
202 - * @remark :扩展模块数量  
203 - * @name :blogNum  
204 - * @author :lyh  
205 - * @method :post  
206 - * @time :2025/1/4 11:21  
207 - */  
208 - public function customNum(){  
209 - $contentModel = new CustomModuleContent();  
210 - $number = $contentModel->counts(['status'=>0]);  
211 - $settingModel = new SettingNum();  
212 - $info = $settingModel->read(['type'=>2]);  
213 - if($info === false){  
214 - $news_page_number = 10;  
215 - }else{  
216 - $news_page_number = $info['num'];  
217 - }  
218 - $cateModel = new CustomModuleCategory();  
219 - $cateList = $cateModel->list(['status'=>0]);  
220 - if(!empty($cateList)){  
221 - foreach ($cateList as $v){  
222 - $cate_num = $contentModel->counts(['category_id'=>['like',','.$v['id'].',']]);  
223 - if($cate_num == 0){  
224 - $number += 1;  
225 - }else{  
226 - $number += ceil($cate_num / $news_page_number);  
227 - }  
228 - }  
229 - }  
230 - return $number;  
231 - }  
232 - /**  
233 * @remark :获取当前项目选中的语种 76 * @remark :获取当前项目选中的语种
234 * @name :getCountry 77 * @name :getCountry
235 * @author :lyh 78 * @author :lyh
@@ -26,6 +26,7 @@ use App\Models\Inquiry\InquiryIP; @@ -26,6 +26,7 @@ use App\Models\Inquiry\InquiryIP;
26 use App\Models\Inquiry\InquirySet; 26 use App\Models\Inquiry\InquirySet;
27 use App\Models\Manage\Manage; 27 use App\Models\Manage\Manage;
28 use App\Models\Project\After; 28 use App\Models\Project\After;
  29 +use App\Models\Project\AggregateKeywordComment;
29 use App\Models\Project\AiBlogTask; 30 use App\Models\Project\AiBlogTask;
30 use App\Models\Project\DeployBuild; 31 use App\Models\Project\DeployBuild;
31 use App\Models\Project\DeployOptimize; 32 use App\Models\Project\DeployOptimize;
@@ -427,6 +428,12 @@ class ProjectLogic extends BaseLogic @@ -427,6 +428,12 @@ class ProjectLogic extends BaseLogic
427 $this->param['deploy_build']['is_supplier'] = 1; 428 $this->param['deploy_build']['is_supplier'] = 1;
428 } 429 }
429 } 430 }
  431 + //聚合页评论为空时,生成评论
  432 + $keywordCommentModel = new AggregateKeywordComment();
  433 + $commentNum = $keywordCommentModel->counts(['project_id'=>$param['id']]);
  434 + if(empty($commentNum)){
  435 + NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD_COMMON, ['project_id' => $this->param['project_id']]);
  436 + }
430 } 437 }
431 if($param['type'] == Project::TYPE_FIVE){ 438 if($param['type'] == Project::TYPE_FIVE){
432 $param['extend_type'] = Project::TYPE_FIVE; 439 $param['extend_type'] = Project::TYPE_FIVE;
@@ -15,7 +15,6 @@ Route::middleware(['aloginauth'])->group(function () { @@ -15,7 +15,6 @@ Route::middleware(['aloginauth'])->group(function () {
15 Route::any('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); 15 Route::any('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white');
16 Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址 16 Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址
17 Route::any('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify'); 17 Route::any('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify');
18 - Route::any('/countLanguagePage', [Aside\Com\CNoticeController::class, 'countLanguagePage'])->name('admin.countLanguagePage');//统计页面数量  
19 Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry'); 18 Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry');
20 Route::any('/getDynamicPassword', [Aside\Com\IndexController::class, 'getDynamicPassword'])->name('admin.getDynamicPassword'); 19 Route::any('/getDynamicPassword', [Aside\Com\IndexController::class, 'getDynamicPassword'])->name('admin.getDynamicPassword');
21 Route::any('/notAiHumanizer', [Aside\Com\IndexController::class, 'notAiHumanizer'])->name('admin.notAiHumanizer'); 20 Route::any('/notAiHumanizer', [Aside\Com\IndexController::class, 'notAiHumanizer'])->name('admin.notAiHumanizer');