作者 zhl

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

@@ -52,9 +52,9 @@ class LyhImportTest extends Command @@ -52,9 +52,9 @@ class LyhImportTest extends Command
52 * @time :2023/11/20 15:13 52 * @time :2023/11/20 15:13
53 */ 53 */
54 public function handle(){ 54 public function handle(){
55 - ProjectServer::useProject(3951); 55 + ProjectServer::useProject(3654);
56 echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; 56 echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
57 - $this->import2140CustomModule('https://ecdn6.globalso.com/upload/p/2140/file/2025-05/daoru.csv',3951); 57 + $this->importProductCategory('https://ecdn6-nc.globalso.com/upload/p/3654/file/2025-06/products-1.csv',3654);
58 DB::disconnect('custom_mysql'); 58 DB::disconnect('custom_mysql');
59 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 59 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
60 } 60 }
@@ -129,23 +129,43 @@ class LyhImportTest extends Command @@ -129,23 +129,43 @@ class LyhImportTest extends Command
129 if($k < 1){ 129 if($k < 1){
130 continue; 130 continue;
131 } 131 }
132 - if(empty($val[1])){  
133 - echo '跳过的名称:'.$val[1]; 132 + if(empty($val[0])){
  133 + echo '跳过的名称:'.$val[0];
134 continue; 134 continue;
135 } 135 }
136 try { 136 try {
137 - $categoryModel->edit(['sort'=>$val[1]],['title'=>$val[0]]);  
138 -// $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$val[1],'seo_title'=>$val[0],'seo_des'=>$val[2]]);  
139 -// $pid = 0;  
140 -// if($val[2] != 0){  
141 -// //查询上级id  
142 -// $pidCate = $categoryModel->read(['seo_title'=>$val[2]]);  
143 -// if($pidCate !== false){  
144 -// $pid = $pidCate['id'];  
145 -// }  
146 -// }  
147 -// $route = RouteMap::setRoute($val[1],RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id);  
148 -// $categoryModel->edit(['route'=>$route,'pid'=>$pid],['id'=>$id]); 137 + $cateArr = explode('/',$val[0]);
  138 + $pid = 0;
  139 + $two_pid = 0;
  140 + foreach ($cateArr as $key => $item){
  141 + if($key == 0){
  142 + //查看一级分类是否存在
  143 + $info = $categoryModel->read(['title'=>$item,'pid'=>0],['id']);
  144 + if($info === false){
  145 + $pid = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item]);
  146 + //设置路由
  147 + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$pid,$project_id);
  148 + $categoryModel->edit(['route'=>$route],['id'=>$pid]);
  149 + }else{
  150 + $pid = $info['id'];
  151 + }
  152 + }elseif ($key == 1){
  153 + //查看当前下面的子级别是否存在
  154 + $two_info = $categoryModel->read(['title'=>$item,'pid'=>$pid],['id']);
  155 + if($two_info === false){
  156 + $two_pid = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item,'pid'=>$pid]);
  157 + //设置路由
  158 + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$two_pid,$project_id);
  159 + $categoryModel->edit(['route'=>$route],['id'=>$two_pid]);
  160 + }else{
  161 + $two_pid = $two_info['id'];
  162 + }
  163 + }else{
  164 + $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item,'pid'=>$two_pid]);
  165 + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id);
  166 + $categoryModel->edit(['route'=>$route],['id'=>$id]);
  167 + }
  168 + }
149 echo date('Y-m-d H:i:s') . '产品分类id:'.PHP_EOL; 169 echo date('Y-m-d H:i:s') . '产品分类id:'.PHP_EOL;
150 }catch (\Exception $e){ 170 }catch (\Exception $e){
151 echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1]; 171 echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1];
@@ -35,7 +35,6 @@ class UpdateKeyword extends Command @@ -35,7 +35,6 @@ class UpdateKeyword extends Command
35 35
36 36
37 public function handle(){ 37 public function handle(){
38 - dd(1111);  
39 while (true){ 38 while (true){
40 $keywordPageModel = new KeywordPage(); 39 $keywordPageModel = new KeywordPage();
41 $lists = $keywordPageModel->list(['status'=>0]); 40 $lists = $keywordPageModel->list(['status'=>0]);
@@ -142,7 +142,7 @@ class IndexController extends BaseController @@ -142,7 +142,7 @@ class IndexController extends BaseController
142 Cache::add($token,$info,12 * 3600); 142 Cache::add($token,$info,12 * 3600);
143 $languageModel = new WebLanguage(); 143 $languageModel = new WebLanguage();
144 $languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']); 144 $languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']);
145 - $data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo]; 145 + $data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo,'project_seo_type'=>$info['project_seo_type']];
146 $this->response('success',Code::SUCCESS,$data); 146 $this->response('success',Code::SUCCESS,$data);
147 } 147 }
148 148
@@ -210,7 +210,7 @@ class CNoticeController extends BaseController @@ -210,7 +210,7 @@ class CNoticeController extends BaseController
210 * 更新通知C端 210 * 更新通知C端
211 * @param Request $request 211 * @param Request $request
212 * @return \Illuminate\Http\JsonResponse 212 * @return \Illuminate\Http\JsonResponse
213 - * @param : type : 1->主站更新 4->聚合页更新 213 + * @param : type : 1->主站更新 4->聚合页更新 7->ai博客
214 */ 214 */
215 public function sendNotify(Request $request) 215 public function sendNotify(Request $request)
216 { 216 {
@@ -93,7 +93,7 @@ class OperationHeartbeatController extends BaseController @@ -93,7 +93,7 @@ class OperationHeartbeatController extends BaseController
93 if($info === false){ 93 if($info === false){
94 $info = []; 94 $info = [];
95 }else{ 95 }else{
96 - $date_time = strtotime($info['updated_at']) + 120; 96 + $date_time = strtotime($info['updated_at']) + 60;
97 if($date_time < time()){ 97 if($date_time < time()){
98 $operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition); 98 $operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition);
99 $info['status'] = 0; 99 $info['status'] = 0;
@@ -347,11 +347,11 @@ class KeywordController extends BaseController @@ -347,11 +347,11 @@ class KeywordController extends BaseController
347 */ 347 */
348 public function sendComment(KeywordLogic $logic){ 348 public function sendComment(KeywordLogic $logic){
349 $this->request->validate([ 349 $this->request->validate([
350 - 'count' => 'required|integer|max:10', 350 + 'count' => 'required|integer|max:100',
351 ], [ 351 ], [
352 'count.required' => '生成条数不能为空', 352 'count.required' => '生成条数不能为空',
353 'count.integer' => '生成条数必须是整数', 353 'count.integer' => '生成条数必须是整数',
354 - 'count.max' => '生成条数最大不能超过10', 354 + 'count.max' => '生成条数最大不能超过100',
355 ]); 355 ]);
356 $data = $logic->sendComment(); 356 $data = $logic->sendComment();
357 $this->response('success',Code::SUCCESS,$data); 357 $this->response('success',Code::SUCCESS,$data);
@@ -359,7 +359,7 @@ class ProductController extends BaseController @@ -359,7 +359,7 @@ class ProductController extends BaseController
359 } 359 }
360 if (!empty($new_content)){ 360 if (!empty($new_content)){
361 $detailModel = new Detail(); 361 $detailModel = new Detail();
362 - $detailInfo = $detailModel->read(['column_id'=>1]); 362 + $detailInfo = $detailModel->read(['column_id'=>1,'product_id'=>$this->param['product_id']]);
363 if($detailInfo !== false && !empty($detailInfo['content'])){ 363 if($detailInfo !== false && !empty($detailInfo['content'])){
364 $productInfo['content'] = $new_content . $detailInfo['content']['content']; 364 $productInfo['content'] = $new_content . $detailInfo['content']['content'];
365 } 365 }
@@ -26,6 +26,7 @@ class AutoPullNotify extends Base @@ -26,6 +26,7 @@ class AutoPullNotify extends Base
26 22 => '白帽专属服务器01', 26 22 => '白帽专属服务器01',
27 24 => '白帽专属服务器02', 27 24 => '白帽专属服务器02',
28 23 => '西班牙服务器', 28 23 => '西班牙服务器',
  29 + 6 => '自建站服务器群',
29 ]; 30 ];
30 } 31 }
31 32