Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
11 个修改的文件
包含
100 行增加
和
90 行删除
| @@ -107,7 +107,6 @@ class ProjectUpdate extends Command | @@ -107,7 +107,6 @@ class ProjectUpdate extends Command | ||
| 107 | $page_list = array_column($data_page, 'path'); | 107 | $page_list = array_column($data_page, 'path'); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | - $is_flush = 0; | ||
| 111 | //设置数据库 | 110 | //设置数据库 |
| 112 | $project = ProjectServer::useProject($project_id); | 111 | $project = ProjectServer::useProject($project_id); |
| 113 | if ($project) { | 112 | if ($project) { |
| @@ -250,8 +249,6 @@ class ProjectUpdate extends Command | @@ -250,8 +249,6 @@ class ProjectUpdate extends Command | ||
| 250 | foreach ($items as $item) { | 249 | foreach ($items as $item) { |
| 251 | $route = $this->get_url_route($item['url'] ?? ''); | 250 | $route = $this->get_url_route($item['url'] ?? ''); |
| 252 | if ($route) { | 251 | if ($route) { |
| 253 | - $product = $model->read(['route' => $route], 'id'); | ||
| 254 | - if (!$product) { | ||
| 255 | //图片 | 252 | //图片 |
| 256 | $gallery = []; | 253 | $gallery = []; |
| 257 | if ($item['images'] ?? []) { | 254 | if ($item['images'] ?? []) { |
| @@ -265,8 +262,12 @@ class ProjectUpdate extends Command | @@ -265,8 +262,12 @@ class ProjectUpdate extends Command | ||
| 265 | $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); | 262 | $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); |
| 266 | $category_id = $logic->getLastCategory(array_column($category_arr, 'id')); | 263 | $category_id = $logic->getLastCategory(array_column($category_arr, 'id')); |
| 267 | } | 264 | } |
| 268 | - try { | 265 | + //名称去掉特殊符号 |
| 269 | $item['ttile'] = $this->special2str($item['ttile'] ?? ''); | 266 | $item['ttile'] = $this->special2str($item['ttile'] ?? ''); |
| 267 | + | ||
| 268 | + try { | ||
| 269 | + $product = $model->read(['route' => $route], 'id'); | ||
| 270 | + if (!$product) { | ||
| 270 | $id = $model->insertGetId([ | 271 | $id = $model->insertGetId([ |
| 271 | 'project_id' => $project_id, | 272 | 'project_id' => $project_id, |
| 272 | 'title' => $item['ttile'], | 273 | 'title' => $item['ttile'], |
| @@ -290,43 +291,25 @@ class ProjectUpdate extends Command | @@ -290,43 +291,25 @@ class ProjectUpdate extends Command | ||
| 290 | ]); | 291 | ]); |
| 291 | $this->set_map($route, RouteMap::SOURCE_PRODUCT, $id, $project_id); | 292 | $this->set_map($route, RouteMap::SOURCE_PRODUCT, $id, $project_id); |
| 292 | 293 | ||
| 293 | - //扩展字段 | ||
| 294 | - if ($item['extend'] ?? []) { | ||
| 295 | - foreach (array_reverse($item['extend']) as $ke => $ve) { | ||
| 296 | - $extend = $extend_model->read(['title' => $ke]); | ||
| 297 | - if (!$extend) { | ||
| 298 | - $extend_key = $this->get_extend_key($extend_model); | ||
| 299 | - $extend_model->add([ | ||
| 300 | - 'project_id' => $project_id, | ||
| 301 | - 'title' => $ke, | ||
| 302 | - 'type' => 1, | ||
| 303 | - 'key' => $extend_key | ||
| 304 | - ]); | 294 | + CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list, $page_list); |
| 305 | } else { | 295 | } else { |
| 306 | - $extend_key = $extend['key']; | ||
| 307 | - } | ||
| 308 | - | ||
| 309 | - $extend_info = $extend_info_model->read(['key' => $extend_key, 'product_id' => $id]); | ||
| 310 | - if (!$extend_info) { | ||
| 311 | - $extend_info_model->add([ | ||
| 312 | - 'key' => $extend_key, | ||
| 313 | - 'project_id' => $project_id, | ||
| 314 | - 'product_id' => $id, | ||
| 315 | - 'values' => $ve, | ||
| 316 | - 'type' => 1 | ||
| 317 | - ]); | ||
| 318 | - } | ||
| 319 | - } | 296 | + $id = $product['id']; |
| 297 | + $model->edit([ | ||
| 298 | + 'title' => $item['ttile'], | ||
| 299 | + 'intro' => $item['short_description'] ?? '', | ||
| 300 | + 'content' => $item['content'] ?? '', | ||
| 301 | + 'category_id' => $category_id, | ||
| 302 | + 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', | ||
| 303 | + 'gallery' => Arr::a2s($gallery), | ||
| 304 | + 'seo_mate' => Arr::a2s([ | ||
| 305 | + 'title' => $item['ttile'], | ||
| 306 | + 'keyword' => $item['keywords'] ?? '', | ||
| 307 | + 'description' => $item['description'] ?? '' | ||
| 308 | + ]), | ||
| 309 | + 'sort' => $item['sort'] ?? 0, | ||
| 310 | + ], ['id' => $id]); | ||
| 320 | } | 311 | } |
| 321 | 312 | ||
| 322 | - CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list, $page_list); | ||
| 323 | - $is_flush = 1; | ||
| 324 | - } catch (\Exception $e) { | ||
| 325 | - echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL; | ||
| 326 | - continue; | ||
| 327 | - } | ||
| 328 | - }else{ | ||
| 329 | - $id = $product['id']; | ||
| 330 | //扩展字段 | 313 | //扩展字段 |
| 331 | if ($item['extend'] ?? []) { | 314 | if ($item['extend'] ?? []) { |
| 332 | foreach (array_reverse($item['extend']) as $ke => $ve) { | 315 | foreach (array_reverse($item['extend']) as $ke => $ve) { |
| @@ -355,6 +338,9 @@ class ProjectUpdate extends Command | @@ -355,6 +338,9 @@ class ProjectUpdate extends Command | ||
| 355 | } | 338 | } |
| 356 | } | 339 | } |
| 357 | } | 340 | } |
| 341 | + } catch (\Exception $e) { | ||
| 342 | + echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL; | ||
| 343 | + continue; | ||
| 358 | } | 344 | } |
| 359 | } | 345 | } |
| 360 | } | 346 | } |
| @@ -388,23 +374,25 @@ class ProjectUpdate extends Command | @@ -388,23 +374,25 @@ class ProjectUpdate extends Command | ||
| 388 | foreach ($items as $item) { | 374 | foreach ($items as $item) { |
| 389 | $route = $this->get_url_route($item['url'] ?? ''); | 375 | $route = $this->get_url_route($item['url'] ?? ''); |
| 390 | if ($route) { | 376 | if ($route) { |
| 391 | - $news = $model->read(['url' => $route], 'id'); | ||
| 392 | - if (!$news) { | ||
| 393 | //分类 | 377 | //分类 |
| 394 | $category_id = ''; | 378 | $category_id = ''; |
| 395 | if ($api_type == 'news' && ($item['category'] ?? [])) { | 379 | if ($api_type == 'news' && ($item['category'] ?? [])) { |
| 396 | $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); | 380 | $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); |
| 397 | $category_id = $logic->getCategory(array_column($category_arr, 'id')); | 381 | $category_id = $logic->getCategory(array_column($category_arr, 'id')); |
| 398 | } | 382 | } |
| 399 | - try { | ||
| 400 | - $item['ttile'] = $this->special2str($item['ttile'] ?? ''); | ||
| 401 | - | 383 | + //图片 |
| 402 | if (is_array($item['images'])) { | 384 | if (is_array($item['images'])) { |
| 403 | $image = $item['images'][0] ?? ''; | 385 | $image = $item['images'][0] ?? ''; |
| 404 | } else { | 386 | } else { |
| 405 | $image = $item['images'] ?? ''; | 387 | $image = $item['images'] ?? ''; |
| 406 | } | 388 | } |
| 389 | + $new_img = $this->source_download($image, $project_id, $domain_arr['host'], $web_url_domain, $home_url); | ||
| 390 | + //名称去掉特殊符号 | ||
| 391 | + $item['ttile'] = $this->special2str($item['ttile'] ?? ''); | ||
| 407 | 392 | ||
| 393 | + try { | ||
| 394 | + $news = $model->read(['url' => $route], 'id'); | ||
| 395 | + if (!$news) { | ||
| 408 | $id = $model->insertGetId([ | 396 | $id = $model->insertGetId([ |
| 409 | 'project_id' => $project_id, | 397 | 'project_id' => $project_id, |
| 410 | 'name' => $item['ttile'], | 398 | 'name' => $item['ttile'], |
| @@ -413,7 +401,7 @@ class ProjectUpdate extends Command | @@ -413,7 +401,7 @@ class ProjectUpdate extends Command | ||
| 413 | 'seo_keywords' => $item['keywords'] ?? '', | 401 | 'seo_keywords' => $item['keywords'] ?? '', |
| 414 | 'seo_description' => $item['description'] ?? '', | 402 | 'seo_description' => $item['description'] ?? '', |
| 415 | 'text' => $item['content'] ?? '', | 403 | 'text' => $item['content'] ?? '', |
| 416 | - 'image' => $this->source_download($image, $project_id, $domain_arr['host'], $web_url_domain, $home_url), | 404 | + 'image' => $new_img, |
| 417 | 'status' => $api_type == 'news' ? News::STATUS_ONE : Blog::STATUS_ONE, | 405 | 'status' => $api_type == 'news' ? News::STATUS_ONE : Blog::STATUS_ONE, |
| 418 | 'created_at' => $item['post_date'] ?? date('Y-m-d H:i:s'), | 406 | 'created_at' => $item['post_date'] ?? date('Y-m-d H:i:s'), |
| 419 | 'updated_at' => $item['post_date'] ?? date('Y-m-d H:i:s'), | 407 | 'updated_at' => $item['post_date'] ?? date('Y-m-d H:i:s'), |
| @@ -425,7 +413,19 @@ class ProjectUpdate extends Command | @@ -425,7 +413,19 @@ class ProjectUpdate extends Command | ||
| 425 | $this->set_map($route, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $project_id); | 413 | $this->set_map($route, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $project_id); |
| 426 | 414 | ||
| 427 | CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list, $page_list); | 415 | CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list, $page_list); |
| 428 | - $is_flush = 1; | 416 | + } else { |
| 417 | + $id = $news['id']; | ||
| 418 | + $model->edit([ | ||
| 419 | + 'name' => $item['ttile'], | ||
| 420 | + 'category_id' => $category_id, | ||
| 421 | + 'seo_title' => $item['ttile'], | ||
| 422 | + 'seo_keywords' => $item['keywords'] ?? '', | ||
| 423 | + 'seo_description' => $item['description'] ?? '', | ||
| 424 | + 'text' => $item['content'] ?? '', | ||
| 425 | + 'image' => $new_img, | ||
| 426 | + 'sort' => $item['sort'] ?? 0, | ||
| 427 | + ], ['id' => $id]); | ||
| 428 | + } | ||
| 429 | } catch (\Exception $e) { | 429 | } catch (\Exception $e) { |
| 430 | echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL; | 430 | echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL; |
| 431 | continue; | 431 | continue; |
| @@ -434,7 +434,6 @@ class ProjectUpdate extends Command | @@ -434,7 +434,6 @@ class ProjectUpdate extends Command | ||
| 434 | } | 434 | } |
| 435 | } | 435 | } |
| 436 | } | 436 | } |
| 437 | - } | ||
| 438 | } else { | 437 | } else { |
| 439 | return true; | 438 | return true; |
| 440 | } | 439 | } |
| @@ -457,10 +456,11 @@ class ProjectUpdate extends Command | @@ -457,10 +456,11 @@ class ProjectUpdate extends Command | ||
| 457 | foreach ($items as $item) { | 456 | foreach ($items as $item) { |
| 458 | $route = $this->get_url_route($item['url'] ?? ''); | 457 | $route = $this->get_url_route($item['url'] ?? ''); |
| 459 | if ($route) { | 458 | if ($route) { |
| 459 | + //名称去掉特殊符号 | ||
| 460 | + $item['ttile'] = $this->special2str($item['ttile'] ?? ''); | ||
| 461 | + try { | ||
| 460 | $custom = $model->read(['url' => $route], 'id'); | 462 | $custom = $model->read(['url' => $route], 'id'); |
| 461 | if (!$custom) { | 463 | if (!$custom) { |
| 462 | - try { | ||
| 463 | - $item['ttile'] = $this->special2str($item['ttile'] ?? ''); | ||
| 464 | $id = $model->insertGetId([ | 464 | $id = $model->insertGetId([ |
| 465 | 'project_id' => $project_id, | 465 | 'project_id' => $project_id, |
| 466 | 'name' => $item['ttile'], | 466 | 'name' => $item['ttile'], |
| @@ -478,7 +478,16 @@ class ProjectUpdate extends Command | @@ -478,7 +478,16 @@ class ProjectUpdate extends Command | ||
| 478 | $this->set_map($route, RouteMap::SOURCE_PAGE, $id, $project_id); | 478 | $this->set_map($route, RouteMap::SOURCE_PAGE, $id, $project_id); |
| 479 | 479 | ||
| 480 | CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PAGE, $id, $link_type, $language_list, $page_list); | 480 | CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PAGE, $id, $link_type, $language_list, $page_list); |
| 481 | - $is_flush = 1; | 481 | + } else { |
| 482 | + $id = $custom['id']; | ||
| 483 | + $model->edit([ | ||
| 484 | + 'name' => $item['ttile'], | ||
| 485 | + 'title' => $item['ttile'], | ||
| 486 | + 'keywords' => $item['keywords'] ?? '', | ||
| 487 | + 'description' => $item['description'] ?? '', | ||
| 488 | + 'html' => $item['content'] ?? '', | ||
| 489 | + ], ['id' => $id]); | ||
| 490 | + } | ||
| 482 | } catch (\Exception $e) { | 491 | } catch (\Exception $e) { |
| 483 | echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL; | 492 | echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL; |
| 484 | continue; | 493 | continue; |
| @@ -487,7 +496,6 @@ class ProjectUpdate extends Command | @@ -487,7 +496,6 @@ class ProjectUpdate extends Command | ||
| 487 | } | 496 | } |
| 488 | } | 497 | } |
| 489 | } | 498 | } |
| 490 | - } | ||
| 491 | } else { | 499 | } else { |
| 492 | return true; | 500 | return true; |
| 493 | } | 501 | } |
| @@ -497,9 +505,6 @@ class ProjectUpdate extends Command | @@ -497,9 +505,6 @@ class ProjectUpdate extends Command | ||
| 497 | DB::disconnect('custom_mysql'); | 505 | DB::disconnect('custom_mysql'); |
| 498 | 506 | ||
| 499 | $task->status = UpdateLog::STATUS_COM;//同步完成 | 507 | $task->status = UpdateLog::STATUS_COM;//同步完成 |
| 500 | - if ($is_flush) { | ||
| 501 | - $task->collect_status = UpdateLog::COLLECT_STATUS_UN; | ||
| 502 | - } | ||
| 503 | $task->save(); | 508 | $task->save(); |
| 504 | 509 | ||
| 505 | echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', task_type: ' . $api_type . ', update end ' . PHP_EOL; | 510 | echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', task_type: ' . $api_type . ', update end ' . PHP_EOL; |
| @@ -11,6 +11,7 @@ namespace App\Console\Commands; | @@ -11,6 +11,7 @@ namespace App\Console\Commands; | ||
| 11 | 11 | ||
| 12 | use App\Models\Blog\Blog; | 12 | use App\Models\Blog\Blog; |
| 13 | use App\Models\Blog\BlogCategory; | 13 | use App\Models\Blog\BlogCategory; |
| 14 | +use App\Models\CustomModule\CustomModule; | ||
| 14 | use App\Models\News\News; | 15 | use App\Models\News\News; |
| 15 | use App\Models\News\NewsCategory; | 16 | use App\Models\News\NewsCategory; |
| 16 | use App\Models\Product\Category; | 17 | use App\Models\Product\Category; |
| @@ -45,7 +46,7 @@ class UpdateMainHtml extends Command | @@ -45,7 +46,7 @@ class UpdateMainHtml extends Command | ||
| 45 | * | 46 | * |
| 46 | * @var string | 47 | * @var string |
| 47 | */ | 48 | */ |
| 48 | - protected $description = '洗数据'; | 49 | + protected $description = '生成视频模块'; |
| 49 | 50 | ||
| 50 | /** | 51 | /** |
| 51 | * @remark :统一更新路由 | 52 | * @remark :统一更新路由 |
| @@ -60,45 +61,24 @@ class UpdateMainHtml extends Command | @@ -60,45 +61,24 @@ class UpdateMainHtml extends Command | ||
| 60 | foreach ($list as $v){ | 61 | foreach ($list as $v){ |
| 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 62 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 62 | ProjectServer::useProject($v['id']); | 63 | ProjectServer::useProject($v['id']); |
| 63 | - $this->editMainHtml($v['id']); | 64 | + $this->initModule($v['id']); |
| 64 | DB::disconnect('custom_mysql'); | 65 | DB::disconnect('custom_mysql'); |
| 65 | } | 66 | } |
| 66 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 67 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 67 | } | 68 | } |
| 68 | 69 | ||
| 69 | - /** | ||
| 70 | - * @remark :洗数据 | ||
| 71 | - * @name :getMainHtml | ||
| 72 | - * @author :lyh | ||
| 73 | - * @method :post | ||
| 74 | - * @time :2023/12/27 18:03 | ||
| 75 | - */ | ||
| 76 | - public function editMainHtml($project_id){ | ||
| 77 | - $templateModel = new BTemplate(); | ||
| 78 | - $info = $templateModel->read(['source'=>4,'source_id'=>0]); | ||
| 79 | - if($info !== false){ | ||
| 80 | - $mainModel = new BTemplateMain(); | ||
| 81 | - $mainInfo = $mainModel->read(['type'=>4,'is_list'=>1]); | ||
| 82 | - if($mainInfo === false){ | 70 | + public function initModule($project_id){ |
| 71 | + $moduleModel = new CustomModule(); | ||
| 72 | + $info = $moduleModel->read(['route'=>'video']); | ||
| 73 | + if($info === false){ | ||
| 83 | $data = [ | 74 | $data = [ |
| 84 | - 'type'=>4, | ||
| 85 | - 'is_list'=>1, | ||
| 86 | - 'main_html'=>$info['main_html'], | ||
| 87 | - 'main_css'=>$info['main_css'], | ||
| 88 | - 'section_list_id'=>$info['section_list_id'], | ||
| 89 | - 'project_id'=>$project_id | ||
| 90 | - ]; | ||
| 91 | - $mainModel->add($data); | ||
| 92 | - }else{ | ||
| 93 | - $data = [ | ||
| 94 | - 'main_html'=>$info['main_html'], | ||
| 95 | - 'main_css'=>$info['main_css'], | ||
| 96 | - 'section_list_id'=>$info['section_list_id'], | 75 | + 'name'=>'视频模块', |
| 97 | 'project_id'=>$project_id, | 76 | 'project_id'=>$project_id, |
| 77 | + 'route'=>'video', | ||
| 98 | ]; | 78 | ]; |
| 99 | - $mainModel->edit($data,['id'=>$mainInfo['id']]); | ||
| 100 | - } | 79 | + $moduleModel->add($data); |
| 101 | } | 80 | } |
| 102 | return true; | 81 | return true; |
| 103 | } | 82 | } |
| 83 | + | ||
| 104 | } | 84 | } |
| @@ -108,6 +108,8 @@ class OptimizeController extends BaseController | @@ -108,6 +108,8 @@ class OptimizeController extends BaseController | ||
| 108 | 'gl_project.is_remain_today AS is_remain_today', | 108 | 'gl_project.is_remain_today AS is_remain_today', |
| 109 | 'gl_project.remain_day AS remain_day', | 109 | 'gl_project.remain_day AS remain_day', |
| 110 | 'gl_project.robots AS robots', | 110 | 'gl_project.robots AS robots', |
| 111 | + 'gl_project.is_translate AS is_translate', | ||
| 112 | + 'gl_project.is_translate_tag AS is_translate_tag', | ||
| 111 | 'gl_project_online_check.id AS online_check_id', | 113 | 'gl_project_online_check.id AS online_check_id', |
| 112 | 'gl_project_online_check.question AS question', | 114 | 'gl_project_online_check.question AS question', |
| 113 | 'gl_project_online_check.go_question AS go_question', | 115 | 'gl_project_online_check.go_question AS go_question', |
| @@ -275,4 +277,26 @@ class OptimizeController extends BaseController | @@ -275,4 +277,26 @@ class OptimizeController extends BaseController | ||
| 275 | } | 277 | } |
| 276 | $this->response('success',Code::SUCCESS,['url'=>$domain.'robots.txt']); | 278 | $this->response('success',Code::SUCCESS,['url'=>$domain.'robots.txt']); |
| 277 | } | 279 | } |
| 280 | + | ||
| 281 | + /** | ||
| 282 | + * @remark :更改状态 | ||
| 283 | + * @name :editTranslateStatus | ||
| 284 | + * @author :lyh | ||
| 285 | + * @method :post | ||
| 286 | + * @time :2023/12/29 15:28 | ||
| 287 | + */ | ||
| 288 | + public function editTranslateStatus(){ | ||
| 289 | + $this->request->validate([ | ||
| 290 | + 'project_id'=>'required', | ||
| 291 | + 'status'=>'required', | ||
| 292 | + 'type'=>'required', | ||
| 293 | + ],[ | ||
| 294 | + 'project_id.required' => 'project_id不能为空', | ||
| 295 | + 'status.required' => 'status不能为空', | ||
| 296 | + 'type.required' => 'type不能为空', | ||
| 297 | + ]); | ||
| 298 | + $projectModel = new Project(); | ||
| 299 | + $projectModel->edit([$this->param['type']=>$this->param['status']],['id'=>$this->param['project_id']]); | ||
| 300 | + $this->response('success'); | ||
| 301 | + } | ||
| 278 | } | 302 | } |
| @@ -29,11 +29,9 @@ class ComController extends BaseController | @@ -29,11 +29,9 @@ class ComController extends BaseController | ||
| 29 | public function get_menu(){ | 29 | public function get_menu(){ |
| 30 | //根据当前登录用户角色返回用户菜单列表 | 30 | //根据当前登录用户角色返回用户菜单列表 |
| 31 | $projectMenuModel = new ProjectMenuModel(); | 31 | $projectMenuModel = new ProjectMenuModel(); |
| 32 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export(11111, true) . PHP_EOL, FILE_APPEND); | ||
| 33 | if($this->user['role_id'] != 0){ | 32 | if($this->user['role_id'] != 0){ |
| 34 | $this->map = $this->getNoAdminMenuCondition(); | 33 | $this->map = $this->getNoAdminMenuCondition(); |
| 35 | }else{ | 34 | }else{ |
| 36 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($this->map, true) . PHP_EOL, FILE_APPEND); | ||
| 37 | $this->map = $this->getAdminMenuCondition(); | 35 | $this->map = $this->getAdminMenuCondition(); |
| 38 | } | 36 | } |
| 39 | $lists = $projectMenuModel->list($this->map,'sort'); | 37 | $lists = $projectMenuModel->list($this->map,'sort'); |
| @@ -45,7 +45,6 @@ class FileManageController extends BaseController | @@ -45,7 +45,6 @@ class FileManageController extends BaseController | ||
| 45 | $this->map['project_id'] = $this->user['project_id']; | 45 | $this->map['project_id'] = $this->user['project_id']; |
| 46 | $this->request['name'] && $this->map['name'] = ['like','%'.$this->request['name'].'%']; | 46 | $this->request['name'] && $this->map['name'] = ['like','%'.$this->request['name'].'%']; |
| 47 | $lists = $fileManage->lists($this->map, $this->page, $this->row); | 47 | $lists = $fileManage->lists($this->map, $this->page, $this->row); |
| 48 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($lists, true) . PHP_EOL, FILE_APPEND); | ||
| 49 | if(!empty($lists) && !empty($lists['list'])){ | 48 | if(!empty($lists) && !empty($lists['list'])){ |
| 50 | foreach ($lists['list'] as $k => $v){ | 49 | foreach ($lists['list'] as $k => $v){ |
| 51 | $v['download_url'] = url('b/file_manager_downLoad?path='.$v['path']); | 50 | $v['download_url'] = url('b/file_manager_downLoad?path='.$v['path']); |
| @@ -89,7 +89,6 @@ class NewsController extends BaseController | @@ -89,7 +89,6 @@ class NewsController extends BaseController | ||
| 89 | $str = []; | 89 | $str = []; |
| 90 | $str[] = $this->map['category_id']; | 90 | $str[] = $this->map['category_id']; |
| 91 | $this->getAllSub($this->map['category_id'],$str); | 91 | $this->getAllSub($this->map['category_id'],$str); |
| 92 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($str, true) . PHP_EOL, FILE_APPEND); | ||
| 93 | $query->where(function ($subQuery) use ($str) { | 92 | $query->where(function ($subQuery) use ($str) { |
| 94 | foreach ($str as $v) { | 93 | foreach ($str as $v) { |
| 95 | $subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", [$v]); | 94 | $subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", [$v]); |
| @@ -75,8 +75,10 @@ class BTemplateLogic extends BaseLogic | @@ -75,8 +75,10 @@ class BTemplateLogic extends BaseLogic | ||
| 75 | if($templateInfo === false){ | 75 | if($templateInfo === false){ |
| 76 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//处理定制页面初始数据 | 76 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//处理定制页面初始数据 |
| 77 | $html = $this->isCustomizedPage($this->param['source'],$is_list);//获取定制页面的html | 77 | $html = $this->isCustomizedPage($this->param['source'],$is_list);//获取定制页面的html |
| 78 | + if(!empty($html)){ | ||
| 78 | return $this->success(['html'=>$html,'template_id'=>$template_id]); | 79 | return $this->success(['html'=>$html,'template_id'=>$template_id]); |
| 79 | } | 80 | } |
| 81 | + } | ||
| 80 | $mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码 | 82 | $mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码 |
| 81 | }else{ | 83 | }else{ |
| 82 | if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 | 84 | if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 |
| @@ -230,6 +230,9 @@ class ProductLogic extends BaseLogic | @@ -230,6 +230,9 @@ class ProductLogic extends BaseLogic | ||
| 230 | $arr = []; | 230 | $arr = []; |
| 231 | $keywordModel = new Keyword(); | 231 | $keywordModel = new Keyword(); |
| 232 | foreach ($keyword as $v){ | 232 | foreach ($keyword as $v){ |
| 233 | + if(empty($v)){ | ||
| 234 | + continue; | ||
| 235 | + } | ||
| 233 | //查询当前关键字是否存在 | 236 | //查询当前关键字是否存在 |
| 234 | $info = $keywordModel->read(['title'=>$v],['id']); | 237 | $info = $keywordModel->read(['title'=>$v],['id']); |
| 235 | if($info === false){ | 238 | if($info === false){ |
| @@ -480,7 +480,6 @@ class RankDataLogic extends BaseLogic | @@ -480,7 +480,6 @@ class RankDataLogic extends BaseLogic | ||
| 480 | $model->lang = $lang; | 480 | $model->lang = $lang; |
| 481 | $model->data = $data; | 481 | $model->data = $data; |
| 482 | $model->updated_date = date('Y-m-d'); | 482 | $model->updated_date = date('Y-m-d'); |
| 483 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($model, true) . PHP_EOL, FILE_APPEND); | ||
| 484 | $model->save(); | 483 | $model->save(); |
| 485 | } | 484 | } |
| 486 | } | 485 | } |
| @@ -263,6 +263,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -263,6 +263,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 263 | Route::any('/getAiPrefix', [Aside\Optimize\OptimizeController::class, 'getAiPrefix'])->name('admin.optimize_getAiPrefix');//获取Ai前后缀 | 263 | Route::any('/getAiPrefix', [Aside\Optimize\OptimizeController::class, 'getAiPrefix'])->name('admin.optimize_getAiPrefix');//获取Ai前后缀 |
| 264 | Route::any('/saveAiPrefix', [Aside\Optimize\OptimizeController::class, 'saveAiPrefix'])->name('admin.optimize_saveAiPrefix');//保存Ai前后缀 | 264 | Route::any('/saveAiPrefix', [Aside\Optimize\OptimizeController::class, 'saveAiPrefix'])->name('admin.optimize_saveAiPrefix');//保存Ai前后缀 |
| 265 | Route::any('/setRobots', [Aside\Optimize\OptimizeController::class, 'setRobots'])->name('admin.optimize_setRobots');//设置robots开关 | 265 | Route::any('/setRobots', [Aside\Optimize\OptimizeController::class, 'setRobots'])->name('admin.optimize_setRobots');//设置robots开关 |
| 266 | + Route::any('/editTranslateStatus', [Aside\Optimize\OptimizeController::class, 'editTranslateStatus'])->name('admin.optimize_editTranslateStatus');//设置robots开关 | ||
| 266 | }); | 267 | }); |
| 267 | //生成关键字 | 268 | //生成关键字 |
| 268 | Route::prefix('create_keyword')->group(function () { | 269 | Route::prefix('create_keyword')->group(function () { |
| @@ -274,7 +274,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -274,7 +274,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 274 | Route::prefix('inquiry')->group(function () { | 274 | Route::prefix('inquiry')->group(function () { |
| 275 | Route::get('/', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'index'])->name('inquiry'); | 275 | Route::get('/', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'index'])->name('inquiry'); |
| 276 | Route::get('/form_list', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'form_list'])->name('inquiry_form_list'); | 276 | Route::get('/form_list', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'form_list'])->name('inquiry_form_list'); |
| 277 | - Route::get('/info', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'info'])->name('inquiry_info'); | 277 | + Route::any('/info', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'info'])->name('inquiry_info'); |
| 278 | Route::any('/delete', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'delete'])->name('inquiry_delete'); | 278 | Route::any('/delete', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'delete'])->name('inquiry_delete'); |
| 279 | Route::any('/export', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'export'])->name('inquiry_export'); | 279 | Route::any('/export', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'export'])->name('inquiry_export'); |
| 280 | }); | 280 | }); |
-
请 注册 或 登录 后发表评论