作者 李美松

修改代码

正在显示 41 个修改的文件 包含 1156 行增加221 行删除
... ... @@ -75,13 +75,39 @@ class HtmlCollect extends Command
$collect_info->status = CollectTask::STATUS_ING;
$collect_info->save();
//获取站点正式和测试域名
$web_url_domain = $collect_info->domain;
$home_url = $collect_info->domain;
$url_web_config = 'https://' . $collect_info->domain . '/wp-content/cache/user_config.text';
$data_config = http_get($url_web_config, ['charset' => 'UTF-8']);
if ($data_config) {
$web_url_arr = parse_url($data_config['web_url_domain'] ?? '');
if (isset($web_url_arr['host'])) {
$web_url_domain = $web_url_arr['host'];
}
$home_url_arr = parse_url($data_config['home_url'] ?? '');
if (isset($home_url_arr['host'])) {
$home_url = $home_url_arr['host'];
}
}
//采集html页面,下载资源到本地并替换
try {
$html = file_get_contents('https://' . $collect_info->domain . $collect_info->route);
$source_list = $this->html_preg($html, $project_id, $collect_info->domain);
$opts = [
'http' => [
'header' => 'User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0'
],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
]
];
$html = file_get_contents('https://' . $collect_info->domain . $collect_info->route, false, stream_context_create($opts));
$source_list = $this->html_preg($html, $project_id, $collect_info->domain, $web_url_domain, $home_url);
if ($source_list) {
$html = $this->upload_source($html, $source_list, $project_id);
$html = $this->upload_source($html, $source_list, $project_id, $opts);
}
} catch (\Exception $e) {
$collect_info->status = CollectTask::STATUS_FAIL;
... ... @@ -164,7 +190,7 @@ class HtmlCollect extends Command
}
//正则匹配html资源
protected function html_preg($html, $project_id, $domain)
protected function html_preg($html, $project_id, $domain, $web_url_domain, $home_url)
{
$source = [];
... ... @@ -176,7 +202,7 @@ class HtmlCollect extends Command
preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_img);
$img = $result_img[2] ?? [];
foreach ($img as $vi) {
$check_vi = $this->url_check($vi, $project_id, $domain);
$check_vi = $this->url_check($vi, $project_id, $domain, $web_url_domain, $home_url);
$check_vi && $source[] = $check_vi;
}
... ... @@ -184,7 +210,7 @@ class HtmlCollect extends Command
preg_match_all('/<script\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_js);
$js = $result_js[2] ?? [];
foreach ($js as $vj) {
$check_vj = $this->url_check($vj, $project_id, $domain);
$check_vj = $this->url_check($vj, $project_id, $domain, $web_url_domain, $home_url);
$check_vj && $source[] = $check_vj;
}
... ... @@ -192,7 +218,7 @@ class HtmlCollect extends Command
preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_video);
$video = $result_video[2] ?? [];
foreach ($video as $vv) {
$check_vv = $this->url_check($vv, $project_id, $domain);
$check_vv = $this->url_check($vv, $project_id, $domain, $web_url_domain, $home_url);
$check_vv && $source[] = $check_vv;
}
... ... @@ -200,7 +226,7 @@ class HtmlCollect extends Command
preg_match_all('/<link\s+[^>]*?href\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_css);
$css = $result_css[2] ?? [];
foreach ($css as $vc) {
$check_vc = $this->url_check($vc, $project_id, $domain);
$check_vc = $this->url_check($vc, $project_id, $domain, $web_url_domain, $home_url);
$check_vc && $source[] = $check_vc;
}
... ... @@ -208,7 +234,7 @@ class HtmlCollect extends Command
preg_match_all("/url\(['\"]?(\s*[^>]+?)['\"]?\)/i", $html, $result_css_b);
$css_b = $result_css_b[1] ?? [];
foreach ($css_b as $vc_b) {
$check_vc_b = $this->url_check($vc_b, $project_id, $domain);
$check_vc_b = $this->url_check($vc_b, $project_id, $domain, $web_url_domain, $home_url);
$check_vc_b && $source[] = $check_vc_b;
}
... ... @@ -217,7 +243,7 @@ class HtmlCollect extends Command
}
//判断资源是否需要下载
protected function url_check($url, $project_id, $domain)
protected function url_check($url, $project_id, $domain, $web_url_domain, $home_url)
{
if ($url) {
$arr = parse_url($url);
... ... @@ -227,11 +253,10 @@ class HtmlCollect extends Command
$query = $arr['query'] ?? '';
if (
(strpos($host, '.globalso.') === false) &&
(strpos($host, '.goodao.') === false) &&
$path && (strpos($path, '.') !== false)
(empty($host) || $host == $web_url_domain || $host == $home_url)
&& $path
&& (strpos($path, '.') !== false)
) {
$source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
if (!$source) {
return [
... ... @@ -255,7 +280,7 @@ class HtmlCollect extends Command
}
//下载并替换资源
protected function upload_source($html, $source, $project_id)
protected function upload_source($html, $source, $project_id, $opts)
{
foreach ($source as $vs) {
... ... @@ -273,7 +298,7 @@ class HtmlCollect extends Command
if (substr($new_source, -3, 3) == 'css') {
// 下载css文件中的资源
$css_html = file_get_contents($vs['url_complete']);
$css_html = file_get_contents($vs['url_complete'], false, stream_context_create($opts));
preg_match_all("/url\(['\"](\s*[^>]+?)['\"]\)/i", $css_html, $result_css_source);
$css_source = $result_css_source[1] ?? [];
... ... @@ -290,6 +315,9 @@ class HtmlCollect extends Command
if (!$vcs) {
continue;
}
if (strpos($vcs, '.') === false) {
continue;
}
$source_info = CollectSource::where('project_id', $project_id)->where('origin', $vcs)->first();
if ($source_info) {
... ...
... ... @@ -75,13 +75,38 @@ class HtmlLanguageCollect extends Command
$collect_info->status = CollectTask::STATUS_ING;
$collect_info->save();
$web_url_domain = $collect_info->domain;
$home_url = $collect_info->domain;
$url_web_config = 'https://' . $collect_info->domain . '/wp-content/cache/user_config.text';
$data_config = http_get($url_web_config, ['charset' => 'UTF-8']);
if ($data_config) {
$web_url_arr = parse_url($data_config['web_url_domain'] ?? '');
if (isset($web_url_arr['host'])) {
$web_url_domain = $web_url_arr['host'];
}
$home_url_arr = parse_url($data_config['home_url'] ?? '');
if (isset($home_url_arr['host'])) {
$home_url = $home_url_arr['host'];
}
}
//采集html页面,下载资源到本地并替换
try {
$html = file_get_contents('https://' . $collect_info->domain . $collect_info->route);
$source_list = $this->html_preg($html, $project_id, $collect_info->domain);
$opts = [
'http' => [
'header' => 'User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0'
],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
]
];
$html = file_get_contents('https://' . $collect_info->domain . $collect_info->route, false, stream_context_create($opts));
$source_list = $this->html_preg($html, $project_id, $collect_info->domain, $web_url_domain, $home_url);
if ($source_list) {
$html = $this->upload_source($html, $source_list, $project_id);
$html = $this->upload_source($html, $source_list, $project_id, $opts);
}
} catch (\Exception $e) {
$collect_info->status = CollectTask::STATUS_FAIL;
... ... @@ -164,7 +189,7 @@ class HtmlLanguageCollect extends Command
}
//正则匹配html资源
protected function html_preg($html, $project_id, $domain)
protected function html_preg($html, $project_id, $domain, $web_url_domain, $home_url)
{
$source = [];
... ... @@ -176,7 +201,7 @@ class HtmlLanguageCollect extends Command
preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_img);
$img = $result_img[2] ?? [];
foreach ($img as $vi) {
$check_vi = $this->url_check($vi, $project_id, $domain);
$check_vi = $this->url_check($vi, $project_id, $domain, $web_url_domain, $home_url);
$check_vi && $source[] = $check_vi;
}
... ... @@ -184,7 +209,7 @@ class HtmlLanguageCollect extends Command
preg_match_all('/<script\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_js);
$js = $result_js[2] ?? [];
foreach ($js as $vj) {
$check_vj = $this->url_check($vj, $project_id, $domain);
$check_vj = $this->url_check($vj, $project_id, $domain, $web_url_domain, $home_url);
$check_vj && $source[] = $check_vj;
}
... ... @@ -192,7 +217,7 @@ class HtmlLanguageCollect extends Command
preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_video);
$video = $result_video[2] ?? [];
foreach ($video as $vv) {
$check_vv = $this->url_check($vv, $project_id, $domain);
$check_vv = $this->url_check($vv, $project_id, $domain, $web_url_domain, $home_url);
$check_vv && $source[] = $check_vv;
}
... ... @@ -200,7 +225,7 @@ class HtmlLanguageCollect extends Command
preg_match_all('/<link\s+[^>]*?href\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_css);
$css = $result_css[2] ?? [];
foreach ($css as $vc) {
$check_vc = $this->url_check($vc, $project_id, $domain);
$check_vc = $this->url_check($vc, $project_id, $domain, $web_url_domain, $home_url);
$check_vc && $source[] = $check_vc;
}
... ... @@ -208,7 +233,7 @@ class HtmlLanguageCollect extends Command
preg_match_all("/url\(['\"]?(\s*[^>]+?)['\"]?\)/i", $html, $result_css_b);
$css_b = $result_css_b[1] ?? [];
foreach ($css_b as $vc_b) {
$check_vc_b = $this->url_check($vc_b, $project_id, $domain);
$check_vc_b = $this->url_check($vc_b, $project_id, $domain, $web_url_domain, $home_url);
$check_vc_b && $source[] = $check_vc_b;
}
... ... @@ -217,7 +242,7 @@ class HtmlLanguageCollect extends Command
}
//判断资源是否需要下载
protected function url_check($url, $project_id, $domain)
protected function url_check($url, $project_id, $domain, $web_url_domain, $home_url)
{
if ($url) {
$arr = parse_url($url);
... ... @@ -227,11 +252,10 @@ class HtmlLanguageCollect extends Command
$query = $arr['query'] ?? '';
if (
(strpos($host, '.globalso.') === false) &&
(strpos($host, '.goodao.') === false) &&
$path && (strpos($path, '.') !== false)
(empty($host) || $host == $web_url_domain || $host == $home_url)
&& $path
&& (strpos($path, '.') !== false)
) {
$source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
if (!$source) {
return [
... ... @@ -255,7 +279,7 @@ class HtmlLanguageCollect extends Command
}
//下载并替换资源
protected function upload_source($html, $source, $project_id)
protected function upload_source($html, $source, $project_id, $opts)
{
foreach ($source as $vs) {
... ... @@ -273,7 +297,7 @@ class HtmlLanguageCollect extends Command
if (substr($new_source, -3, 3) == 'css') {
// 下载css文件中的资源
$css_html = file_get_contents($vs['url_complete']);
$css_html = file_get_contents($vs['url_complete'], false, stream_context_create($opts));
preg_match_all("/url\(['\"](\s*[^>]+?)['\"]\)/i", $css_html, $result_css_source);
$css_source = $result_css_source[1] ?? [];
... ... @@ -290,6 +314,9 @@ class HtmlLanguageCollect extends Command
if (!$vcs) {
continue;
}
if (strpos($vcs, '.') === false) {
continue;
}
$source_info = CollectSource::where('project_id', $project_id)->where('origin', $vcs)->first();
if ($source_info) {
... ...
... ... @@ -91,6 +91,13 @@ class ProjectUpdate extends Command
if ($data_language) {
$language_list = array_column($data_language, 'short');
}
//获取所有页面
$page_list = [];
$url_page = 'https://' . $domain_arr['host'] . '/wp-content/cache/pages_list.json';
$data_page = http_get($url_page, ['charset' => 'UTF-8']);
if ($data_page) {
$page_list = array_column($data_page, 'path');
}
//设置数据库
$project = ProjectServer::useProject($project_id);
... ... @@ -142,7 +149,7 @@ class ProjectUpdate extends Command
$id = $keyword['id'];
}
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $link_type, $language_list);
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $link_type, $language_list, $page_list);
}
}
}
... ... @@ -274,7 +281,7 @@ class ProjectUpdate extends Command
$id = $product['id'];
}
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list);
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list, $page_list);
}
}
}
... ... @@ -328,7 +335,7 @@ class ProjectUpdate extends Command
$id = $news['id'];
}
CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list);
CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list, $page_list);
}
}
}
... ... @@ -376,7 +383,7 @@ class ProjectUpdate extends Command
$id = $custom['id'];
}
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PAGE, $id, $link_type, $language_list);
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PAGE, $id, $link_type, $language_list, $page_list);
}
}
}
... ...
<?php
/**
* @remark :
* @name :UpdateRoute.php
* @author :lyh
* @method :post
* @time :2023/11/20 15:07
*/
namespace App\Console\Commands;
use App\Models\Blog\Blog;
use App\Models\Blog\BlogCategory;
use App\Models\News\News;
use App\Models\News\NewsCategory;
use App\Models\Product\Category;
use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
/**
* @remark :更新所有项目的路由
* @name :UpdateRoute
* @author :lyh
* @method :post
* @time :2023/11/20 15:08
*/
class UpdateRoute extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update_route';
/**
* The console command description.
*
* @var string
*/
protected $description = '更新路由';
/**
* @remark :统一更新路由
* @name :handle
* @author :lyh
* @method :post
* @time :2023/11/20 15:13
*/
public function handle(){
$projectModel = new Project();
$lists = $projectModel->list(['is_upgrade'=>0,'type'=>['!=',0]]);
foreach ($lists as $k => $v){
echo date('Y-m-d H:i:s') . ' start: 项目id为' . $v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->setProductRoute($v['id']);
$this->setProductKeywordRoute($v['id']);
$this->setBlogRoute($v['id']);
$this->setNewsRoute($v['id']);
$this->setBlogCateRoute($v['id']);
$this->setNewsCateRoute($v['id']);
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . ' end: 项目id为' . $v['id'] . PHP_EOL;
}
/**
* @remark :设置路由
* @name :setRoute
* @author :lyh
* @method :post
* @time :2023/11/20 15:30
*/
public function setProductRoute($project_id){
$productModel = new Product();
$productList = $productModel->list(['status'=>['!=',2]],'id',['id','route']);
foreach ($productList as $v){
$route = preg_replace('/-product.*/', '', $v['route']);
$route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT, $v['id'], $project_id);
$route = $route.'-product';
$productModel->edit(['route'=>$route],['id'=>$v['id']]);
RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT, $v['id'], $project_id);
}
return true;
}
/**
* @remark :设置路由
* @name :setRoute
* @author :lyh
* @method :post
* @time :2023/11/20 15:30
*/
public function setNewsRoute($project_id){
$newsModel = new News();
$newsList = $newsModel->list(['status'=>['!=',2]],'id',['id','url']);
foreach ($newsList as $v){
RouteMap::setRoute($v['url'], RouteMap::SOURCE_NEWS, $v['id'], $project_id);
}
return true;
}
/**
* @remark :设置路由
* @name :setRoute
* @author :lyh
* @method :post
* @time :2023/11/20 15:30
*/
public function setNewsCateRoute($project_id){
$newsCateModel = new NewsCategory();
$newsList = $newsCateModel->list([],'id',['id','alias']);
foreach ($newsList as $v){
RouteMap::setRoute($v['alias'], RouteMap::SOURCE_NEWS_CATE, $v['id'], $project_id);
}
return true;
}
/**
* @remark :设置路由
* @name :setRoute
* @author :lyh
* @method :post
* @time :2023/11/20 15:30
*/
public function setBlogRoute($project_id){
$blogModel = new Blog();
$blogList = $blogModel->list(['status'=>['!=',2]],'id',['id','url']);
foreach ($blogList as $v){
RouteMap::setRoute($v['url'], RouteMap::SOURCE_BLOG, $v['id'], $project_id);
}
return true;
}
/**
* @remark :设置路由
* @name :setRoute
* @author :lyh
* @method :post
* @time :2023/11/20 15:30
*/
public function setBlogCateRoute($project_id){
$blogCateModel = new BlogCategory();
$blogList = $blogCateModel->list([],'id',['id','alias']);
foreach ($blogList as $v){
RouteMap::setRoute($v['alias'], RouteMap::SOURCE_BLOG_CATE, $v['id'], $project_id);
}
return true;
}
/**
* @remark :设置路由
* @name :setRoute
* @author :lyh
* @method :post
* @time :2023/11/20 15:30
*/
public function setProductKeywordRoute($project_id){
$keywordModel = new Keyword();
$keywordList = $keywordModel->list([],'id',['id','route']);
foreach ($keywordList as $v){
if(!ends_with($v['route'],'-tag')){
$route = $v['route'].'-tag';
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
RouteMap::setRoute($route, RouteMap::SOURCE_BLOG_CATE, $v['id'], $project_id);
}
}
return true;
}
}
... ...
... ... @@ -180,7 +180,8 @@ class UpdateSeoTdk extends Command
Redis::expire($cache_key, 120);
echo date('Y-m-d H:i:s') . '更新--' . $table . ': 项目id' . $project_id . ':id' . $v['id'] . PHP_EOL;
$v = DB::connection('custom_mysql')->table($table)->where('id', $v['id'])->first();
$v = (array)$v;
$data = [];
$json_field = '';
foreach ($map as $ai_key => $field) {
... ...
<?php
namespace App\Console\Commands;
use App\Helper\Arr;
use App\Helper\Common;
use App\Helper\Gpt;
use App\Helper\Translate;
use App\Models\Ai\AiCommand;
use App\Models\Mail\Mail;
use App\Models\Project\DeployOptimize;
use App\Models\Project\Project;
use App\Models\Project\ProjectUpdateTdk;
use App\Models\User\User;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
/**
* 初始化项目
* Class InitProject
* @package App\Console\Commands
* @author zbj
* @date 2023/10/8
*/
class UpdateSeoTdkCrontab extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update_seo_tdk_crontab';
/**
* The console command description.
*
* @var string
*/
protected $description = '一键生成tdk';
/**
* @return bool
*/
public function handle()
{
$project_ids = Project::where('type', Project::TYPE_TWO)->pluck('id')->toArray();
foreach ($project_ids as $project_id){
ProjectUpdateTdk::add_task($project_id);
}
}
}
... ...
... ... @@ -6,6 +6,7 @@ use App\Enums\Common\Code;
use App\Enums\Common\Common;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Manage\MenuLogic;
use App\Models\Inquiry\InquiryData;
use App\Models\Manage\Manage;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Hash;
... ... @@ -71,4 +72,28 @@ class IndexController extends BaseController
$this->response('success');
}
/**
* @remark :同步询盘记录
* @name :sync_inquiry
* @author :lyh
* @method :post
* @time :2023/11/16 9:51
*/
public function sync_inquiry(){
$this->request->validate([
'data' => 'required|array',
'identifying'=>'required',
], [
'data.required' => '自定义询盘数据不为空',
'data.array' => '必须为数组',
'identifying.required' => '唯一标识不为空',
]);
$inquiryModel = new InquiryData();
$rs = $inquiryModel->add($this->param);
if($rs === false){
$this->response('error',Code::SYSTEM_ERROR);
}
$this->response('success');
}
}
... ...
... ... @@ -13,6 +13,7 @@ use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Models\ASide\APublicModel;
use App\Models\Channel\Channel;
use App\Models\Domain\DomainInfo;
use App\Models\Manage\Manage;
use App\Models\Project\OnlineCheck;
use App\Models\Project\Project;
... ... @@ -82,7 +83,6 @@ class OnlineController extends BaseController
'gl_project_deploy_optimize.assist_mid AS optimize_assist_mid',
'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid',
'gl_project_deploy_optimize.domain AS domain',
'gl_project_payment.amount AS amount',
];
return $select;
}
... ... @@ -127,9 +127,14 @@ class OnlineController extends BaseController
* @time :2023/8/18 10:58
*/
public function searchParam(&$query){
//搜索条件处理
if(isset($this->map['title'])){
$query = $query->where('gl_project.title','like','%'.$this->map['title'].'%');
if(!empty($this->map['search']) && !empty($this->map['search_type'])){
// 搜索域名
if($this->map['search_type'] == 'test_domain'){
$query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['search'].'%');
} else {
// 搜索名称
$query->where('gl_project.title', 'like', '%' . $this->map['search'] . '%');
}
}
$query = $query->where('gl_project.status',1);//TODO::已提交审核
return $query;
... ...
... ... @@ -103,6 +103,7 @@ class OptimizeController extends BaseController
'gl_project.finish_remain_day AS finish_remain_day',
'gl_project.is_remain_today AS is_remain_today',
'gl_project.remain_day AS remain_day',
'gl_project.robots AS robots',
'gl_project_online_check.id AS online_check_id',
'gl_project_online_check.question AS question',
'gl_project_online_check.go_question AS go_question',
... ... @@ -224,4 +225,27 @@ class OptimizeController extends BaseController
}
$this->response('success');
}
/**
* @remark :设置开关
* @name :setRobots
* @author :lyh
* @method :post
* @time :2023/11/20 9:42
*/
public function setRobots(){
$this->request->validate([
'robots'=>'required',
'project_id'=>'required',
],[
'robots.required' => 'robots不能为空',
'project_id.required' => 'project_id不能为空',
]);
$projectModel = new Project();
$rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]);
if($rs === false){
$this->response('系统错误,请联系管理员',Code::SYSTEM_ERROR);
}
$this->response('success');
}
}
... ...
... ... @@ -14,6 +14,8 @@ use App\Http\Requests\Aside\Project\ProcessRecordsRequest;
use App\Http\Requests\Aside\Project\ProjectRequest;
use App\Models\ASide\APublicModel;
use App\Models\Channel\Channel;
use App\Models\Channel\User;
use App\Models\Channel\Zone;
use App\Models\Com\City;
use App\Models\Devops\ServerConfig;
use App\Models\Domain\DomainInfo;
... ... @@ -204,6 +206,9 @@ class ProjectController extends BaseController
if(isset($this->map['channel_id']) && !empty($this->map['channel_id'])){
$query->where('gl_project.channel','like','%"channel_id": "'.$this->map['channel_id'].'"%');
}
if(isset($this->map['user_id']) && !empty($this->map['user_id'])){
$query->where('gl_project.channel','like','%"user_id": "'.$this->map['channel_id'].'"%');
}
return $query;
}
... ... @@ -800,10 +805,72 @@ class ProjectController extends BaseController
],[
'project_id.required' => 'project_id不能为空',
]);
$token = $logic->getSiteToken($this->map);
$this->response('success',Code::SUCCESS,['site_token' => $token]);
}
/**
* @remark :单独保存其他项目配置
* @name :saveOtherProject
* @author :lyh
* @method :post
* @time :2023/11/17 15:23
*/
public function saveOtherProject(ProjectLogic $logic){
$this->request->validate([
'id'=>'required',
'aicc'=>'required',
'hagro'=>'required',
'exclusive_aicc_day'=>'required',
'exclusive_hagro_day'=>'required',
],[
'id.required' => 'id不能为空',
'aicc.required' => 'aicc是否开启不能为空',
'hagro.required' => 'hagro是否开启不能为空',
'exclusive_aicc_day.required' => '服务天数不能为空',
'exclusive_hagro_day.required' => '服务天数不能为空',
]);
$logic->saveOtherProject();
$this->response('success');
}
/**
* @remark :获取其他项目配置
* @name :getOtherProject
* @author :lyh
* @method :post
* @time :2023/11/17 15:23
*/
public function getOtherProject(ProjectLogic $logic){
$this->request->validate([
'id'=>'required',
],[
'id.required' => 'id不能为空',
]);
$info = $logic->getOtherProject();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :获取渠道信息
* @name :getChannel
* @author :lyh
* @method :post
* @time :2023/11/17 16:08
*/
public function getChannel(){
$zoneModel = new Zone();
$zone_list = $zoneModel->list();
$channelModel = new Channel();
$channelUserModel = new User();
foreach ($zone_list as $k => $v){
$channel_list = $channelModel->list(['zone_id'=>$v['id']]);
foreach ($channel_list as $k1 => $v1){
$user_list = $channelUserModel->list(['channel_id'=>$v1['id']]);
$channel_list[$k1]['sub'] = $user_list;
}
$zone_list[$k]['sub'] = $channel_list;
}
$this->response('success',Code::SUCCESS,$zone_list);
}
}
... ...
... ... @@ -24,7 +24,7 @@ class BlogController extends BaseController
* @time :2023/9/14 10:45
*/
public function lists(BlogModel $blogModel){
$filed = ['id','category_id','operator_id','status','created_at','label_id','image','updated_at','name','sort','url'];
$filed = ['id','category_id','operator_id','status','created_at','label_id','image','updated_at','name','sort','url','release_at'];
$this->order = 'sort';
$query = $blogModel->orderBy($this->order ,'desc')->orderBy('id','desc');
$query = $this->searchParam($query);
... ...
... ... @@ -16,7 +16,6 @@ use App\Helper\Common;
use App\Helper\Translate;
use App\Helper\Wechat;
use App\Http\Logic\Bside\User\UserLoginLogic;
use App\Models\Channel\Channel;
use App\Models\Domain\DomainInfo;
use App\Models\Project\Project;
use App\Models\Service\Service;
... ... @@ -25,9 +24,7 @@ use App\Models\User\DeptUser;
use App\Models\User\ProjectRole;
use App\Models\User\User;
use App\Utils\EncryptUtils;
use App\Utils\LogUtils;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use Mrgoon\AliSms\AliSms;
class LoginController extends BaseController
... ... @@ -302,4 +299,5 @@ class LoginController extends BaseController
}
return $data;
}
}
... ...
... ... @@ -110,4 +110,13 @@ class NavController extends BaseController
$navLogic->navSort();
$this->response('success');
}
/**
* 一键导入子菜单
* @author zbj
* @date 2023/11/21
*/
public function import(){
}
}
... ...
... ... @@ -24,7 +24,7 @@ class NewsController extends BaseController
* @method
*/
public function lists(NewsModel $news){
$filed = ['id','category_id','operator_id','status','created_at','image','updated_at','name','sort','url'];
$filed = ['id','category_id','operator_id','status','created_at','image','updated_at','name','sort','url', 'release_at'];
$this->order = 'sort';
$query = $news->orderBy($this->order ,'desc')->orderBy('id','desc');
$query = $this->searchParam($query);
... ...
... ... @@ -24,6 +24,10 @@ class WebSettingImageController extends BaseController
*/
public function lists(WebSettingImage $webSettingImage){
$list = $webSettingImage->list([],'id',['id','image','type']);
foreach ($list as $k=>$v){
$v['image'] = getImageUrl($v['image']);
$list[$k] = $v;
}
$this->response('success',Code::SUCCESS,$list);
}
... ... @@ -35,16 +39,15 @@ class WebSettingImageController extends BaseController
* @time :2023/9/21 15:17
*/
public function save(WebSettingImage $webSettingImage){
foreach ($this->param['data'] as $v){
if(isset($v['id']) && !empty($v['id'])){
$rs = $webSettingImage->edit($v,['id'=>$v['id']]);
}else{
try {
$webSettingImage->del(['project_id'=>$this->user['project_id']]);
foreach ($this->param['data'] as $v){
$v['project_id'] = $this->user['project_id'];
$rs = $webSettingImage->add($v);
}
if($rs === false){
$this->response('系统错误请联系管理员');
$v['image'] = str_replace_url($v['image']);
$webSettingImage->add($v);
}
}catch (\Exception $e){
$this->response('系统错误请联系管理员');
}
$this->response('success');
}
... ...
... ... @@ -50,23 +50,6 @@ class BTemplateController extends BaseController
}
/**
* @remark :设置默认模板
* @name :setModuleTemplate
* @author :lyh
* @method :post
* @time :2023/6/29 9:39
*/
public function setPublicTemplate(BTemplateLogic $BTemplateLogic){
$this->request->validate([
'template_id'=>['required'],
],[
'template_id.required' => '模版ID不能为空',
]);
$BTemplateLogic->setTemplate();
$this->response('success');
}
/**
* @remark :保存编辑后的模板
* @name :save
* @author :lyh
... ...
... ... @@ -30,9 +30,8 @@ class VisualizationController extends BaseController
* @method :post
* @time :2023/11/15 10:26
*/
public function info(Visualization $visualization){
//查看当前模板是否在可视化中保存
$info = $visualization->read(['source'=>$this->map['source']],['html','source','id','project_id']);
public function info(VisualizationLogic $logic){
$info = $logic->getVisualizationInfo();
if($info === false){
$info = [];
}
... ... @@ -47,13 +46,6 @@ class VisualizationController extends BaseController
* @time :2023/11/15 10:08
*/
public function save(VisualizationLogic $logic){
$this->request->validate([
'source'=>'required',
'html'=>'required',
],[
'source.required' => '类型不能为空',
'html.required' => 'html不能为空',
]);
$logic->saveVisualization();
$this->response('success');
}
... ... @@ -74,7 +66,7 @@ class VisualizationController extends BaseController
'source_id.required' => 'source_id不能为空',
]);
$data = $logic->getHtml();
$this->response('success',Code::SUCCESS,['html'=>$data]);
$this->response('success',Code::SUCCESS,$data);
}
/**
... ...
... ... @@ -84,6 +84,9 @@ class ProjectLogic extends BaseLogic
if(isset($info['is_customized']) && $info['is_customized'] == 1){
$info['is_visualization'] = json_decode($info['is_visualization']);
}
if(isset($info['deploy_build']['other_project']) && !empty($info['deploy_build']['other_project'])){
$info['deploy_build']['other_project']= json_decode($info['deploy_build']['other_project']);
}
return $this->success($info);
}
... ... @@ -692,4 +695,31 @@ class ProjectLogic extends BaseLogic
return $project->site_token;
}
/**
* @remark :保存其他配置
* @name :saveOtherProject
* @author :lyh
* @method :post
* @time :2023/11/17 15:26
*/
public function saveOtherProject(){
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('系统错误,请联系管理员');
}
return $this->success($this->param);
}
/**
* @remark :获取其他配置
* @name :getOtherProject
* @author :lyh
* @method :post
* @time :2023/11/21 15:45
*/
public function getOtherProject(){
$info = $this->model->read(['id'=>$this->param['id']],['aicc','hagro','exclusive_aicc_day','exclusive_hagro_day']);
return $this->success($info);
}
}
... ...
... ... @@ -4,8 +4,11 @@ namespace App\Http\Logic\Aside\Template;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Service\Service as ServiceSettingModel;
use App\Models\Template\BTemplate;
use App\Models\Template\BTemplateCommon;
use App\Models\Template\Template;
use App\Models\Template\Setting;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;
class ATemplateLogic extends BaseLogic
... ... @@ -180,6 +183,8 @@ class ATemplateLogic extends BaseLogic
}else{
$rs = $bSettingModel->edit(['template_id'=>$this->param['template_id']],['id'=>$info['id']]);
}
$this->saveTemplate($this->param['project_id'],$this->param['template_id']);
//保存一条装修数据
if($rs === false){
$this->fail('error');
}
... ... @@ -187,6 +192,41 @@ class ATemplateLogic extends BaseLogic
}
/**
* @remark :设置模版保存装修首页记录
* @name :saveTemplate
* @author :lyh
* @method :post
* @time :2023/11/17 11:04
*/
public function saveTemplate($project_id,$template_id){
$templateInfo = $this->model->read(['id'=>$template_id]);
ProjectServer::useProject($project_id);
$bTemplateModel = new BTemplate();
$info = $bTemplateModel->read(['source'=>1,'template_id'=>$template_id]);
if($info === false){
$data = [
'source'=>1, 'source_id'=>0, 'template_id'=>$template_id, 'main_html'=>$templateInfo['main_html'],
'main_css'=>$templateInfo['main_css'], 'project_id'=>$project_id,
];
$bTemplateModel->add($data);
}
//保存一次公共头部信息
$bCommonTemplateModel = new BTemplateCommon();
$commonInfo = $bCommonTemplateModel->read(['template_id'=>$template_id,'type'=>1]);
if($commonInfo === false){
$commonData = [
'type'=>1, 'template_id'=>$template_id, 'head_html'=>$templateInfo['head_html'],
'head_css'=>$templateInfo['head_css'], 'footer_html'=>$templateInfo['footer_html'],
'footer_css'=>$templateInfo['footer_css'],'project_id'=>$project_id,
'other'=>str_replace('<header','',characterTruncation($templateInfo['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s"))
];
$bCommonTemplateModel->add($commonData);
}
DB::disconnect('custom_mysql');
return $this->success();
}
/**
* @remark :获取选择的模版
* @name :getSettingInfo
* @author :lyh
... ...
... ... @@ -47,8 +47,8 @@ class BTemplateLogic extends BaseLogic
*/
public function publicTemplateLists($map,$page,$row,$order = 'created_at',$filed = ['id','name','image','url','created_at','status','deleted_status']){
$templateModel = new Template();
$map['deleted_status'] = 0;
$map['status'] = 0;
$map['deleted_status'] = BTemplate::STATUS;
$map['status'] = BTemplate::STATUS;
$lists = $templateModel->lists($map,$page,$row,$order,$filed);
return $this->success($lists);
}
... ... @@ -222,32 +222,6 @@ class BTemplateLogic extends BaseLogic
return $commonInfo;
}
/**
* @remark :设置模板
* @name :setTemplate
* @author :lyh
* @method :post
* @time :2023/6/29 9:47
*/
public function setTemplate(){
$bSettingModel = new Setting();
$info = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$param = [
'project_id'=>$this->user['project_id'],
'template_id'=>$this->param['template_id'],
];
$rs = $bSettingModel->add($param);
}else{
$rs = $bSettingModel->edit(['template_id'=>$this->param['template_id']],['project_id'=>$this->user['project_id']]);
}
if($rs === false){
$this->fail('error');
}
return $this->success();
}
/**
* @remark :保存修改后的模版
* @name :templateSave
... ...
... ... @@ -47,8 +47,10 @@ class CustomTemplateLogic extends BaseLogic
if($info === false){
$this->fail('当前数据不存在');
}
$html = $this->getBodyHeaderFooter($info['html'],$info['html_style']);
$info['html'] = $this->getHeadFooter($html);
if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){
$html = $this->getBodyHeaderFooter($info['html'],$info['html_style']);
$info['html'] = $this->getHeadFooter($html);
}
return $this->success($info);
}
... ... @@ -90,15 +92,16 @@ class CustomTemplateLogic extends BaseLogic
*/
public function saveHtml(){
$html = $this->param['html'];
$this->saveCommonTemplate($html);
$this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
$this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
$info = $this->model->read(['id'=>$this->param['id']],['id','is_visualization','url']);
if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){//非定制项目+可视化页面
$this->saveCommonTemplate($html);
$this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
$this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
}
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('系统错误,请联系管理');
}
//TODO::通知网站更新
$info = $this->model->read(['id'=>$this->param['id']],['id','url']);
$data = ['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PAGE, 'route'=>$info['url']];
$this->updateNotify($data);
return $this->success();
... ...
... ... @@ -10,8 +10,14 @@
namespace App\Http\Logic\Bside\BTemplate;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Project\PageSetting;
use App\Models\Service\Service as ServiceSettingModel;
use App\Models\Template\BTemplate;
use App\Models\Template\BTemplateCommon;
use App\Models\Template\BTemplateMain;
use App\Models\Template\Setting;
use App\Models\Template\Template;
use App\Models\Template\TemplateTypeMain;
use App\Models\Visualization\Visualization;
class VisualizationLogic extends BaseLogic
... ... @@ -19,11 +25,56 @@ class VisualizationLogic extends BaseLogic
public function __construct()
{
parent::__construct();
$this->model = new Visualization();
$this->model = new BTemplateMain();
$this->param = $this->requestAll;
}
/**
* @remark :获取代码块
* @name :getVisualizationInfo
* @author :lyh
* @method :post
* @time :2023/11/17 14:44
*/
public function getVisualizationInfo(){
$data = $this->getSource($this->param['type']);
$source = $data['source'];
$source_id = $data['source_id'];
$type = $this->getType($source,$source_id);
$typeArray = [1,3,5,7];//单页数据
if(in_array($type,$typeArray)){
$bTemplateModel = new BTemplate();
$info = $bTemplateModel->read(['source'=>$source,'source_id'=>$source_id,'template_id'=>0]);
if($info === false){
$html = '';
}else{
$html = $info['html'];
}
}else{//模块数据
$bTemplateMainModel = new BTemplateMain();
$info = $bTemplateMainModel->read(['type'=>$type]);
if($info === false){
$html = '';
}else{
$html = $info['main_html'];
}
}
return $this->success(['html'=>$html]);
}
public function getSource($type){
$source_id = 0;
if ($type == 2){$source = 2;$source_id = 1;
}elseif ($type == 3){$source = 2;
}elseif ($type == 4){$source = 3;$source_id = 1;
}elseif ($type == 5){$source = 3;
}elseif ($type == 6){$source = 4;$source_id = 1;
}elseif ($type == 7){$source = 4;
}else{$source = 1;}
return ['source'=>$source,'source_id'=>$source_id];
}
/**
* @remark :保存定制html
* @name :saveHtml
* @author :lyh
... ... @@ -32,11 +83,38 @@ class VisualizationLogic extends BaseLogic
*/
public function saveVisualization(){
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
$this->param['project_id'] = $this->user['project_id'];
$this->model->add($this->param);
$sourceData = $this->getSource($this->param['type']);
$source = $sourceData['source'];
$source_id = $sourceData['source_id'];
$type = $this->param['type'];
$typeArray = [1,3,5,7];//单页数据
if(in_array($type,$typeArray)){
$bTemplateModel = new BTemplate();
$templateInfo = $bTemplateModel->read(['source'=>$source,'source'=>$source_id,'template_id'=>0]);
if($templateInfo === false){
$data = [
'html'=>$this->param['html'],
'project_id'=>$this->user['project_id'],
'source'=>$source,
'source_id'=>$source_id,
];
$bTemplateModel->add($data);
}else{
$bTemplateModel->edit(['html'=>$this->param['html']],['id'=>$templateInfo['id']]);
}
}else{//模块数据
$bTemplateMainModel = new BTemplateMain();
$mainInfo = $bTemplateMainModel->read(['type'=>$type]);
if($mainInfo === false){
$mainData = [
'project_id'=>$this->user['project_id'],
'type'=>$type,
'main_html'=>$this->param['html']
];
$bTemplateMainModel->add($mainData);
}else{
$bTemplateMainModel->edit(['main_html'=>$this->param['html']],['id'=>$mainInfo['id']]);
}
}
}catch (\Exception $e){
$this->fail('系统错误,请联系管理员');
... ... @@ -45,37 +123,145 @@ class VisualizationLogic extends BaseLogic
}
/**
* @remark :可视化装修获取html
* @remark :定制页面支持可视化装修获取html
* @name :getHtml
* @author :lyh
* @method :post
* @time :2023/11/15 11:30
*/
public function getHtml(){
$type = $this->getType($this->param['source'],$this->param['source_id']);//获取类型
$page_array = (array)$this->user['is_visualization']->page_array;//获取定制界面
//查看当前类型是否是定制界面
if(in_array($type,$page_array)){//是定制界面
if(in_array($type,[1,3,5,7])){//单页
$templateInfo = $this->getWebTemplate($this->param['source'],$this->param['source_id']);//查看当前定制单页是否有代码块
if($templateInfo === false){
$this->fail('请先上传定制代码块');
}
return ['html'=>$templateInfo['html']];
}else{//模块页
$templateInfo = $this->getWebTemplate($this->param['source'],$this->param['source_id']);//查看当前页面是否可视化
if($templateInfo === false){//获取代码块
$bTemplateMainModel = new BTemplateMain();
$mainInfo = $bTemplateMainModel->read(['type'=>$type]);
if($mainInfo === false){
$this->fail('请先上传定制代码块');
}
return ['html'=>$mainInfo['main_html']];
}
return ['html'=>$templateInfo['html']];
}
}else{//非定制界面
$bSettingModel = new Setting();
$settingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
if($settingInfo === false){
$this->fail('请先选择模版');
}
$templateInfo = $this->getWebTemplate($this->param['source'],$this->param['source_id'],$settingInfo['template_id']);//查看当前页面是否可视化
if($templateInfo === false){
//根据类型在获取中间部分
$mainData = $this->getCommonMain($this->param['source'],$this->param['source_id']);
}else{
$mainData = [
'main_html'=>$templateInfo['main_html'],
'main_css'=>$templateInfo['main_css']
];
}
//获取公共头部底部
$commonInfo = $this->getCommonPage($this->param['source'],$this->param['source_id'],$settingInfo['template_id']);
//拼接数据
$html = $commonInfo['head_css'].$mainData['main_css'].$commonInfo['footer_css'].$commonInfo['other'].
$commonInfo['head_html'].$mainData['main_html'].$commonInfo['footer_html'];
$html = $this->getHeadFooter($html);
return ['html'=>$html,'template_id'=>$settingInfo['template_id']];
}
}
/**
* @remark :拼接获取公共头部底部
* @name :getHeadFooter
* @author :lyh
* @method :post
* @time :2023/7/21 17:22
*/
public function getHeadFooter($html){
//获取公共主题头部底部
$serviceSettingModel = new ServiceSettingModel();
$list = $serviceSettingModel->list(['type'=>2],'created_at');
//拼接html
foreach ($list as $v){
if($v['key'] == 'head'){
$html = $v['values'].$html;
}
if($v['key'] == 'footer'){
$html = $html.$v['values'];
}
}
return $html;
}
/**
* @remark :获取可视化装修记录
* @name :getWebTemplate
* @author :lyh
* @method :post
* @time :2023/11/16 11:21
*/
public function getWebTemplate($source,$source_id,$template_id = 0){
//查询可视化是否第一次保存
$bTemplateModel = new BTemplate();
$TemplateInfo = $bTemplateModel->read([
'source'=>$this->param['source'],
$param = [
'source'=>$source,
'project_id'=>$this->user['project_id'],
'source_id'=>$this->param['source_id'],
]);
if($this->param['source'] == 2){
if($this->param['source_id'] == 0){$source = 3;}else{$source = 2;}
'source_id'=>$source_id,
'template_id'=>$template_id
];
return $bTemplateModel->read($param);
}
/**
* @remark :获取类型
* @name :getType
* @author :lyh
* @method :post
* @time :2023/11/16 11:20
*/
public function getType($source,$source_id){
$type = 1;
if($source == 2){
if($source_id == 0){$type = 3;}else{$type = 2;}
}
if($this->param['source'] == 3){
if($this->param['source_id'] == 0){$source = 5;}else{$source = 4;}
if($source == 3){
if($source_id == 0){$type = 5;}else{$type = 4;}
}
if($this->param['source'] == 4){
if($this->param['source_id'] == 0){$source = 7;}else{$source = 6;}
if($source == 4){
if($source_id == 0){$type = 7;}else{$type = 6;}
}
if($TemplateInfo === false){
$info = $this->model->read(['source'=>$source],['html','source','id','project_id']);
if($info === false){
$this->fail('请先上传定制代码块');
return $type;
}
/**
* @remark :获取设置的类型
* @name :getType
* @author :lyh
* @method :post
* @time :2023/10/21 17:29
*/
public function getSaveType($source,$source_id){
$type = 1;//首页公共头部底部
//查看页面是否设置自定义头部底部
if(isset($this->user['configuration']['is_head']) && ($this->user['configuration']['is_head'] != 0)) {
$pageSettingModel = new PageSetting();
$pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id']]);
if ($pageInfo !== false) {
if ($source == 2) {if ($source_id != 0) {if ($pageInfo['product_details'] != 0) {$type = 2;}} else {if ($pageInfo['product_list'] != 0) {$type = 3;}}}
if ($source == 3) {if ($source_id != 0) {if ($pageInfo['blog_details'] != 0) {$type = 4;}} else {if ($pageInfo['blog_list'] != 0) {$type = 5;}}}
if ($source == 4) {if ($source_id != 0) {if ($pageInfo['news_details'] != 0) {$type = 6;}} else {if ($pageInfo['news_list'] != 0) {$type = 7;}}}
if ($source == 5) {if ($pageInfo['polymerization'] != 0) {$type = 8;}}
}
return $info['html'];
}
return $TemplateInfo['html'];
return $type;
}
/**
... ... @@ -86,26 +272,154 @@ class VisualizationLogic extends BaseLogic
* @time :2023/11/15 11:47
*/
public function saveHtml(){
$bTemplateModel = new BTemplate();
$templateInfo = $bTemplateModel->read([
'source'=>$this->param['source'],
'project_id'=>$this->user['project_id'],
'source_id'=>$this->param['source_id'],
]);
$page_array = (array)$this->user['is_visualization']->page_array;
$type = $this->getType($this->param['source'],$this->param['source_id']);
try {
if($templateInfo === false){
$this->param['project_id'] = $this->user['project_id'];
$bTemplateModel->add($this->param);
if(in_array($type,$page_array)){//定制页面
$bTemplateModel = new BTemplate();
$templateInfo = $bTemplateModel->read([
'source'=>$this->param['source'],
'project_id'=>$this->user['project_id'],
'source_id'=>$this->param['source_id'],
]);
if($templateInfo === false){
$this->param['project_id'] = $this->user['project_id'];
$bTemplateModel->add($this->param);
}else{
$bTemplateModel->edit(['html'=>$this->param['html']],['source'=>$this->param['source'],'source_id'=>$this->param['source_id']]);
}
}else{
$bTemplateModel->edit(['html'=>$this->param['html']],['source'=>$this->param['source'],'source_id'=>$this->param['source_id']]);
$bTemplateModel = new BTemplate();
$templateInfo = $bTemplateModel->read([
'source'=>$this->param['source'],
'project_id'=>$this->user['project_id'],
'source_id'=>$this->param['source_id'],
'template_id'=>$this->param['template_id'],
]);
$this->param['main_html'] = characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s');
$this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s');
//保存头部
$this->saveCommonTemplate($this->param['html'],$this->param['source'],$this->param['source_id'],$this->param['template_id']);
if($templateInfo === false){
$this->param['project_id'] = $this->user['project_id'];
$bTemplateModel->add($this->param);
}else{
$bTemplateModel->edit($this->param,['source'=>$this->param['source'],'source_id'=>$this->param['source_id']]);
}
}
}catch (\Exception $e){
$this->fail('系统错误请联系管理员');
$this->fail('系统错误请联系管理员');
}
return $this->success();
}
/**
* @remark :保存头部公共数据
* @name :saveCommonTemplate
* @author :lyh
* @method :post
* @time :2023/10/13 14:27
*/
public function saveCommonTemplate($html,$source,$source_id,$template_id){
$type = $this->getSaveType($source,$source_id);
$templateCommonModel = new BTemplateCommon();
$info = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type]);
$data = [
'head_html'=>characterTruncation($html,'/<header\b[^>]*>(.*?)<\/header>/s'),
'head_css'=>characterTruncation($html,'/<style id="globalsojs-header">(.*?)<\/style>/s'),
'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'),
'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'),
];
$other = str_replace('<header','',characterTruncation($html,"/<link id=\"google-fonts-link\"(.*?)<header/s"));
if($info === false){
$data['template_id'] = $template_id;
$data['project_id'] = $this->user['project_id'];
$data['type'] = $type;
$templateCommonModel->add($data);
}else{
$templateCommonModel->edit($data,['id'=>$info['id']]);
}
//更新所有界面的other
$templateCommonModel->edit(['other'=>$other],['project_id'=>$this->user['project_id']]);
return $this->success();
}
/**
* @remark :获取中间公共部分
* @name :getCommonMain
* @author :lyh
* @method :post
* @time :2023/10/24 15:58
*/
public function getCommonMain($source,$source_id){
$data = [];
if ($source == 2) {if ($source_id != 0) {$type = 2;} else {$type = 3;}}
if ($source == 3) {if ($source_id != 0) {$type = 4;} else {$type = 5;}}
if ($source == 4) {if ($source_id != 0) {$type = 6;} else {$type = 7;}}
if ($source == 5) {$type = 8;}
//查询有没有公共详情模板
$mainInfo = $this->model->read(['type'=>$type]);
if($mainInfo === false){
$data['main_html'] = $this->getModule($type);
$data['main_css'] = "<style id='globalsojs-styles'></style>";
}else{
$data['main_html'] = $mainInfo['main_html'];
$data['main_css'] = $mainInfo['main_css'];
}
return $data;
}
/**
* @remark :默认产品模块
* @name :getProductModule
* @author :lyh
* @method :post
* @time :2023/7/27 15:08
*/
public function getModule($type){
//获取公共主题头部底部
$mainModel = new TemplateTypeMain();
$info = $mainModel->read(['type'=>$type]);
return $info['main_html'];
}
/**
* @remark :根据类型获取公共头和底
* @name :getCommonPage
* @author :lyh
* @method :post
* @time :2023/10/21 16:55
*/
public function getCommonPage($source,$source_id,$template_id){
if(isset($this->user['configuration']['is_head']) && ($this->user['configuration']['is_head'] != 0)) {
//查看页面是否设置自定义头部底部
$pageSettingModel = new PageSetting();
$pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id']]);
if ($pageInfo != false) {
$commonTemplateModel = new BTemplateCommon();
$data = [
'template_id' => $template_id,
'project_id' => $this->user['project_id']
];
if ($source == 2) {//产品页
if($source_id != 0){$data['type'] = 2;if ($pageInfo['product_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}
else {$data['type'] = 3;if ($pageInfo['product_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}}
if ($source == 3) {//博客页
if ($source_id != 0) {$data['type'] = 4;if ($pageInfo['blog_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}
else {$data['type'] = 5;if ($pageInfo['blog_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}}
if ($source == 4) {//新闻页
if ($source_id != 0) {$data['type'] = 6;if ($pageInfo['news_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}
else {$data['type'] = 7;if ($pageInfo['news_list'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}}
if ($source == 5) {//聚合页
$data['type'] = 8;if ($pageInfo['polymerization'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}
}
}
//获取首页公共的头部和底部
if(!isset($commonInfo) || $commonInfo === false){
$commonTemplateModel = new BTemplateCommon();
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>1]);
}
return $commonInfo;
}
}
... ...
... ... @@ -60,8 +60,9 @@ class ExtendLogic extends BaseLogic
$info = $this->model->read(['key'=>$key.$i]);
if($info !== false){
return $this->getKey($key,$i+1);
}else{
return $key.$i;
}
return $key;
}
/**
... ...
... ... @@ -54,15 +54,16 @@ class KeywordLogic extends BaseLogic
$this->param = $this->handleSaveParam($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->model->edit($this->param,['id'=>$this->param['id']]);
$id = $this->param['id'];
}else{
$this->param['project_id'] = $this->user['project_id'];
$this->param['created_at'] = date('Y-m-d H:i:s');
$this->param['updated_at'] = $this->param['created_at'];
$id = $this->model->insertGetId($this->param);
//路由映射
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
}
//路由映射
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
//清除缓存
Common::del_user_cache('product_keyword',$this->user['project_id']);
DB::commit();
... ... @@ -92,6 +93,12 @@ class KeywordLogic extends BaseLogic
if(isset($param['keyword_video']) && !empty($param['keyword_video'])){
$param['keyword_video'] = Arr::a2s($param['keyword_video']);
}
if(!empty($param['related_news_ids'])){
$param['related_news_ids'] = Arr::arrToSet($param['related_news_ids']);
}
if(!empty($param['related_blog_ids'])){
$param['related_blog_ids'] = Arr::arrToSet($param['related_blog_ids']);
}
return $param;
}
... ...
... ... @@ -51,8 +51,8 @@ class ProductLogic extends BaseLogic
$category_ids = $this->getLastCategoryArr($this->param['category_id']);
$this->param['category_id'] = ','.implode(',',$category_ids).',';
}
DB::connection('custom_mysql')->beginTransaction();
try {
// DB::connection('custom_mysql')->beginTransaction();
// try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
//查看路由是否更新
... ... @@ -68,11 +68,11 @@ class ProductLogic extends BaseLogic
CategoryRelated::saveRelated($id, $category_ids);
//保存扩展字段
$this->saveExtendInfo($id,$extend);
DB::connection('custom_mysql')->commit();
}catch (\Exception $e){
DB::connection('custom_mysql')->rollBack();
$this->fail('系统错误请联系管理员');
}
// DB::connection('custom_mysql')->commit();
// }catch (\Exception $e){
// DB::connection('custom_mysql')->rollBack();
// $this->fail('系统错误请联系管理员');
// }
//通知更新
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT, 'route'=>$this->param['route']]);
return $this->success();
... ... @@ -113,7 +113,7 @@ class ProductLogic extends BaseLogic
unset($v['title']);
if($v['type'] == 3 || $v['type'] == 4){
foreach ($v['values'] as $k1=>$v1){
$v1 = str_replace_url($v1);
$v1['url'] = str_replace_url($v1['url']);
$v['values'][$k1] = $v1;
}
$v['values'] = json_encode($v['values']);
... ... @@ -136,6 +136,16 @@ class ProductLogic extends BaseLogic
public function editList(){
$this->param['category_id'] = $this->getLastCategory($this->param['category_id']);
$this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']);
if(isset($this->param['gallery']) && !empty($this->param['gallery'])){
foreach ($this->param['gallery'] as $k => $v){
$v['url'] = str_replace_url($v['url']);
$this->param['gallery'][$k] = $v;
}
$this->param['thumb'] = Arr::a2s($this->param['gallery'][0] ?? []);
$this->param['gallery'] = Arr::a2s($this->param['gallery'] ?? []);
}else{
$this->param['thumb'] = Arr::a2s([]);
}
$this->model->edit($this->param,['id'=>$this->param['id']]);
return $this->success();
}
... ... @@ -191,6 +201,8 @@ class ProductLogic extends BaseLogic
}
$param['thumb'] = Arr::a2s($param['gallery'][0] ?? []);
$param['gallery'] = Arr::a2s($param['gallery'] ?? []);
}else{
$param['thumb'] = Arr::a2s([]);
}
$param['attrs'] = Arr::a2s($param['attrs'] ?? []);
$param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');
... ...
... ... @@ -201,6 +201,7 @@ class UserLoginLogic
$info['upload_config'] = $project['upload_config'];
$info['image_max'] = $project['image_max'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['type'] = $project['type'];
if($info['is_customized'] == 1){
$info['is_visualization'] = json_decode($project['is_visualization']);
}
... ...
... ... @@ -34,6 +34,8 @@ class KeywordRequest extends FormRequest
'seo_title'=>'max:200',
'seo_keywords'=>'max:200',
'seo_description'=>'max:200',
'related_news_ids'=>'array|max:2',
'related_blog_ids'=>'array|max:2',
];
}
... ... @@ -45,6 +47,8 @@ class KeywordRequest extends FormRequest
'seo_title.max' => 'SEO标题不能超过200个字符',
'seo_keywords.max' => 'SEO关键词不能超过200个字符',
'seo_description.max' => 'SEO描述不能超过200个字符',
'related_news_ids.max' => '关联新闻不能超过两条',
'related_blog_ids.max' => '关联博客不能超过两条',
];
}
... ...
... ... @@ -14,6 +14,14 @@ class Blog extends Base
public function user(){
return $this->hasMany(User::class,'operator_id','id');
}
public function getReleaseAtAttribute($value){
if(!$value){
return date('Y-m-d H:i:s', strtotime($this->getAttribute('created_at')));
}
return $value;
}
}
... ...
... ... @@ -2,6 +2,7 @@
namespace App\Models\Channel;
use App\Models\Base;
use Illuminate\Database\Eloquent\Model;
use phpDocumentor\Reflection\Types\Self_;
... ... @@ -11,7 +12,7 @@ use phpDocumentor\Reflection\Types\Self_;
* @author zbj
* @date 2023/6/27
*/
class Channel extends Model
class Channel extends Base
{
//设置关联表名
protected $table = 'gl_channel';
... ...
... ... @@ -2,6 +2,7 @@
namespace App\Models\Channel;
use App\Models\Base;
use Illuminate\Database\Eloquent\Model;
/**
... ... @@ -10,7 +11,7 @@ use Illuminate\Database\Eloquent\Model;
* @author zbj
* @date 2023/6/27
*/
class Zone extends Model
class Zone extends Base
{
//设置关联表名
protected $table = 'gl_channel_zone';
... ...
... ... @@ -17,7 +17,7 @@ class CollectTask extends Base
const STATUS_COM = 2;
const STATUS_FAIL = 3;
public static function _insert($url, $project_id, $source, $source_id, $link_type = 0, $language_list = [])
public static function _insert($url, $project_id, $source, $source_id, $link_type = 0, $language_list = [], $page_list = [])
{
if (!$url) {
return;
... ... @@ -35,47 +35,46 @@ class CollectTask extends Base
];
$task = self::where($where)->first();
$data = [];
$now = date('Y-m-d H:i:s');
if (!$task) {
$now = date('Y-m-d H:i:s');
$data = [
[
$data[] = [
'project_id' => $project_id,
'source' => $source,
'source_id' => $source_id,
'domain' => $url_arr['host'],
'route' => $url_arr['path'],
'language' => '',
'created_at' => $now,
'updated_at' => $now,
];
}
if ($link_type > 0 && $language_list && in_array($url_arr['path'], $page_list)) {
$domain_arr = explode('.', $url_arr['host']);
foreach ($language_list as $v_lan) {
if ($link_type == 1) {
//二级域名
$domain_arr[0] = $v_lan;
$new_domain = implode('.', $domain_arr);
} else {
//二级目录
$new_domain = $url_arr['host'] . '/' . $v_lan;
}
$data[] = [
'project_id' => $project_id,
'source' => $source,
'source_id' => $source_id,
'domain' => $url_arr['host'],
'domain' => $new_domain,
'route' => $url_arr['path'],
'language' => '',
'language' => $v_lan,
'created_at' => $now,
'updated_at' => $now,
]
];
if ($link_type > 0 && $language_list) {
$domain_arr = explode('.', $url_arr['host']);
foreach ($language_list as $v_lan) {
if ($link_type == 1) {
//二级域名
$domain_arr[0] = $v_lan;
$new_domain = implode('.', $domain_arr);
} else {
//二级目录
$new_domain = $url_arr['host'] . '/' . $v_lan;
}
$data[] = [
'project_id' => $project_id,
'source' => $source,
'source_id' => $source_id,
'domain' => $new_domain,
'route' => $url_arr['path'],
'language' => $v_lan,
'created_at' => $now,
'updated_at' => $now,
];
}
];
}
self::insert($data);
}
self::insert($data);
}
}
... ...
<?php
/**
* @remark :
* @name :InquiryData.php
* @author :lyh
* @method :post
* @time :2023/11/16 9:54
*/
namespace App\Models\Inquiry;
use App\Models\Base;
class InquiryData extends Base
{
protected $table = 'gl_inquiry_data';
}
... ...
... ... @@ -21,6 +21,7 @@ class BNav extends Base
use SoftDeletes;
public $hidden = ['deleted_at'];
public $appends = ['able_import'];
/**
... ... @@ -74,4 +75,19 @@ class BNav extends Base
$value = getImageUrl($value);
return $value;
}
/**
* 是否支持一键导入
* @param $value
* @return int
* @author zbj
* @date 2023/11/21
*/
public function getAbleImportAttribute($value)
{
if(in_array($this->url, ['products','news','blogs'])){
return 1;
}
return 0;
}
}
... ...
... ... @@ -15,4 +15,12 @@ class News extends Base
public static function getNumByProjectId($project_id){
return self::where('project_id', $project_id)->where('status', 1)->count();
}
public function getReleaseAtAttribute($value){
if(!$value){
return date('Y-m-d H:i:s', strtotime($this->getAttribute('created_at')));
}
return $value;
}
}
... ...
... ... @@ -56,4 +56,30 @@ class Keyword extends Base
}
return $value;
}
/**
* @param $value
* @return array|mixed
* @author zbj
* @date 2023/11/21
*/
public function getRelatedNewsIdsAttribute($value){
if(!empty($value)){
$value = Arr::setToArr($value);
}
return $value;
}
/**
* @param $value
* @return array|false|mixed|string[]
* @author zbj
* @date 2023/11/21
*/
public function getRelatedBlogIdsAttribute($value){
if(!empty($value)){
$value = Arr::setToArr($value);
}
return $value;
}
}
... ...
... ... @@ -81,7 +81,9 @@ class Product extends Base
public function getThumbAttribute($value){
if(!empty($value)){
$value = json_decode($value,true);
$value['url'] = getImageUrl($value['url']);
if(!empty($value['url'])){
$value['url'] = getImageUrl($value['url']);
}
}
return $value;
}
... ... @@ -91,7 +93,9 @@ class Product extends Base
if(!empty($value)){
$value = Arr::s2a($value);
foreach ($value as $k => $v){
$v['url'] = getImageUrl($v['url']);
if(!empty($v['url'])){
$v['url'] = getImageUrl($v['url']);
}
$value[$k] = $v;
}
}
... ...
... ... @@ -3,7 +3,10 @@
namespace App\Models\RouteMap;
use App\Helper\Translate;
use App\Http\Logic\Aside\Project\ProjectLogic;
use App\Models\Base;
use App\Models\Project\Project;
use App\Models\Template\BTemplate;
/**
* 路由映射表
... ... @@ -54,7 +57,7 @@ class RouteMap extends Base
$sign = generateRoute($title);
$route = $sign;
while(self::isExist($route, $source, $source_id, $project_id)){
$route = $sign .'-'.$i;
$route = $sign .'-'.$i;
$i++;
}
return $route;
... ... @@ -106,24 +109,30 @@ class RouteMap extends Base
}
try {
$route_map = self::where('project_id', $project_id)->where('source_id', $source_id)->where('source', $source)->first();
//上线项目 不能修改链接了
if($route_map){
$project = ProjectLogic::instance()->getInfo($project_id);
if($project['type'] !== Project::STATUS_ONE){
return $route_map->route;
}
}
if(!$route_map){
$route_map = new self();
$route_map->source = $source;
if($source == self::SOURCE_NEWS){
$route_map->path = self::SOURCE_NEWS;
}elseif($source == self::SOURCE_NEWS_CATE){
$route_map->path = self::PATH_NEWS_CATE;
}elseif ($source == self::SOURCE_BLOG){
$route_map->path = self::SOURCE_BLOG;
}elseif ($source == self::SOURCE_BLOG_CATE){
$route_map->path = self::PATH_BLOG_CATE;
}elseif ($source == self::SOURCE_PRODUCT_KEYWORD){
$route = $route.'-tag';
}elseif ($source == self::SOURCE_PRODUCT){
$route = $route.'-product';
}
$route_map->source_id = $source_id;
$route_map->project_id = $project_id;
if ($source == self::SOURCE_PRODUCT_KEYWORD){
$route = self::setKeywordRoute($route);
//查看当前路由是否存在
}elseif ($source == self::SOURCE_PRODUCT){
//产品单独处理路由
$route = self::setProductRoute($route);
}
}
if($source == self::SOURCE_NEWS){
$route_map->path = self::SOURCE_NEWS;
}elseif ($source == self::SOURCE_BLOG){
$route_map->path = self::SOURCE_BLOG;
}
$route_map->route = $route;
$route_map->save();
... ... @@ -135,6 +144,46 @@ class RouteMap extends Base
/**
* @remark :产品新增单独处理路由
* @name :setProductRoute
* @author :lyh
* @method :post
* @time :2023/11/21 18:48
*/
public static function setProductRoute($route,$i = 0){
$route = $route.'-product';
$routeMapModel = new RouteMap();
$routeInfo = $routeMapModel->read(['route'=>$route]);
if($routeInfo === false){
return $route;
}else{
$i = $i + 1;
$route = $route.'-'.$i;
return self::setProductRoute($route,$i);
}
}
/**
* @remark :关键字新增单独处理路由
* @name :setProductRoute
* @author :lyh
* @method :post
* @time :2023/11/21 18:48
*/
public static function setKeywordRoute($route,$i = 0){
$route = $route.'-tag';
$routeMapModel = new RouteMap();
$routeInfo = $routeMapModel->read(['route'=>$route]);
if($routeInfo === false){
return $route;
}else{
$i = $i + 1;
$route = $route.'-'.$i;
return self::setProductRoute($route,$i);
}
}
/**
* @param $route
* @param $project_id
* @return mixed
... ...
... ... @@ -13,7 +13,20 @@ use App\Models\Base;
class BTemplate extends Base
{
const SOURCE_HOME = 1;//首页
const SOURCE_PRODUCT = 2;//产品页
const SOURCE_PRODUCT = 2;//产品
const SOURCE_BLOG = 3;//博客
const SOURCE_NEWS = 4;//新闻详情页
const SOURCE_KEYWORD = 5;//聚合页
const STATUS = 0;
const TYPE_ONE = 0;
const TYPE_TWO = 0;
const TYPE_THREE = 0;
const TYPE_FOUR = 0;
const TYPE_FIVE = 0;
const TYPE_SIX = 0;
const TYPE_SEVEN = 0;
const TYPE_ = 0;
protected $table = 'gl_web_template';
//连接数据库
... ...
... ... @@ -104,7 +104,11 @@ class CosService
'verify_peer_name' => false,
]
];
$body = file_get_contents($file_url,false,stream_context_create($opts));
try {
$body = file_get_contents($file_url,false,stream_context_create($opts));
}catch (\Exception $e){
return '';
}
try {
$cosClient->putObject([
... ...
... ... @@ -172,6 +172,9 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/tdkList', [Aside\Project\ProjectController::class, 'tdkList'])->name('admin.project_tdkList');
Route::any('/copyProject', [Aside\Project\ProjectController::class, 'copyProject'])->name('admin.project_copyProject');
Route::any('/site_token', [Aside\Project\ProjectController::class, 'site_token'])->name('admin.project_site_token');
Route::any('/saveOtherProject', [Aside\Project\ProjectController::class, 'saveOtherProject'])->name('admin.project_saveOtherProject');//其他项目设置
Route::any('/getOtherProject', [Aside\Project\ProjectController::class, 'getOtherProject'])->name('admin.project_getOtherProject');//获取其他项目设置
Route::any('/getChannel', [Aside\Project\ProjectController::class, 'getChannel'])->name('admin.project_getChannel');//其他项目设置
//获取关键词前缀和后缀
Route::prefix('keyword')->group(function () {
Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix');
... ... @@ -249,6 +252,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/', [Aside\Optimize\OptimizeController::class, 'lists'])->name('admin.optimize_lists');//优化中台
Route::any('/getAiPrefix', [Aside\Optimize\OptimizeController::class, 'getAiPrefix'])->name('admin.optimize_getAiPrefix');//获取Ai前后缀
Route::any('/saveAiPrefix', [Aside\Optimize\OptimizeController::class, 'saveAiPrefix'])->name('admin.optimize_saveAiPrefix');//保存Ai前后缀
Route::any('/setRobots', [Aside\Optimize\OptimizeController::class, 'setRobots'])->name('admin.optimize_setRobots');//设置robots开关
});
//优化中台
... ... @@ -343,6 +347,8 @@ Route::group([], function () {
Route::any('get_template_detail', [Aside\Template\ATemplateController::class, 'getTemplateDetail'])->name('admin.get_template_detail');
Route::any('/collect', [Aside\Collect\CollectController::class, 'index'])->name('admin.collect');
//同步询盘
Route::any('/sync_inquiry', [Aside\Com\IndexController::class, 'sync_inquiry'])->name('admin.sync_inquiry');
});
... ...
... ... @@ -301,8 +301,6 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/publicTemplateLists', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'publicTemplateLists'])->name('template_publicTemplateLists');
//获取选中的主题模版
Route::any('/getPublicTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'getPublicTemplate'])->name('template_getPublicTemplate');
//设置默认主题模版
Route::any('/setPublicTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'setPublicTemplate'])->name('template_setPublicTemplate');
//保存修改后的模版
Route::any('/save', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'save'])->name('template_save');
//可视化保存获取数据类型
... ...