作者 赵彬吉

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

<?php
namespace App\Console\Commands;
use App\Http\Logic\Aside\Project\DomainInfoLogic;
use App\Models\Com\UpdateNotify;
use App\Models\Devops\DevopsTask as DevopsTaskModel;
use App\Models\Devops\DevopsTaskLog;
use App\Models\Domain\DomainInfo;
use App\Models\File\File;
use App\Models\File\Image;
use App\Models\Product\CategoryRelated;
use App\Models\Product\Product;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BCustomTemplate;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\DB;
/**
* 测试
* Class Traffic
* @package App\Console\Commands
* @author zbj
* @date 2023/5/18
*/
class Test extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'test';
/**
* The console command description.
*
* @var string
*/
protected $description = '测试';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* @return bool
*/
public function handle()
{
$projects = Project::all();
foreach ($projects as $project){
echo "project " . $project->id;
if(!ProjectServer::useProject($project->id)){
echo '-->' . '未配置数据库' . PHP_EOL;
continue;
}
try {
$page = BCustomTemplate::where('url', '404')->first();
if(!$page){
$page = new BCustomTemplate();
}
$page->project_id = $project->id;
$page->name = '404';
$page->status = 1;
$page->url = '404';
$page->html = '<main>
<section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404"
id="sectionIdyxqu938">
<div class="layout" data-unable="demo01-error404">
<img src="https://ecdn6.globalso.com/upload/m/image_other/2023-10/6528a87e594db30162.png" />
</div>
<p style="text-align: center">SORRY. THE PAGE HAS EITHER MOVED OR CANNOT BE FOUND.</p>
<style>
.section-block-error404 .layout {
height: 700px;
display: flex;
align-items: center;
justify-content: center;
}
.section-block-error404 img {
width: 400px;
}
@media only screen and (max-width:500) {
.section-block-error404 img {
max-width: 100%;
}
}
</style>
<script>
</script>
</section>
</main>';
$page->html_style = '<style id="globalsojs-styles"></style>';
$page->description = 'Sorry. The page has either moved or cannot be found.';
$page->title = '404-Page not found';
$page->save();
$domain = (new DomainInfo())->getDomain($project['deploy_optimize']['domain']);
$url = $domain.'api/delHtml/?project_id='.$project->id.'&route=404';
curlGet($url);
}catch (QueryException | \Exception $e){
echo '-->' . $e->getMessage() . PHP_EOL;
continue;
}
echo '-->成功:' . PHP_EOL;
}
}
}
... ...
<?php
/**
* @remark :
* @name :PageSettingController.php
* @author :lyh
* @method :post
* @time :2023/10/21 15:25
*/
namespace App\Http\Controllers\Bside\BCom;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Project\PageSetting;
class PageSettingController extends BaseController
{
/**
* @remark :根据项目设置获取页面是否使用公共头部底部
* @name :read
* @author :lyh
* @method :post
* @time :2023/10/21 15:26
*/
public function info(){
$pageSettingModel = new PageSetting();
$info = $pageSettingModel->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$info = [
'project_id'=>$this->user['project_id'],
'product_list'=>0,
'product_details'=>0,
'page_keyword'=>0,
'blog_lists'=>0,
'blog_details'=>0,
'news_list'=>0,
'news_details'=>0,
'polymerization'=>0,
];
$pageSettingModel->add($info);
}
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :设置是否使用公共头和底
* @name :edit
* @author :lyh
* @method :post
* @time :2023/10/21 15:36
*/
public function edit(){
$pageSettingModel = new PageSetting();
$rs = $pageSettingModel->edit($this->param,['project_id'=>$this->user['project_id']]);
if($rs === false){
$this->response('系统错误,请联系管理员',Code::SYSTEM_ERROR);
}
$this->response('success');
}
}
... ...
... ... @@ -65,6 +65,9 @@ class BlogController extends BaseController
if(isset($this->map['status'])){
$query = $query->where('status',$this->map['status']);
}
if(isset($this->map['name']) && !empty($this->map['name'])){
$query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%');
}
if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){
$query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]);
}
... ...
... ... @@ -65,6 +65,9 @@ class NewsController extends BaseController
if(isset($this->map['status'])){
$query = $query->where('status',$this->map['status']);
}
if(isset($this->map['name']) && !empty($this->map['name'])){
$query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%');
}
if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){
$query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]);
}
... ...
... ... @@ -65,8 +65,8 @@ class KeywordController extends BaseController
],[
'id.required' => 'ID不能为空'
]);
$data = $logic->getInfo($this->param['id']);
return $this->success(Arr::twoKeepKeys($data, ['id', 'project_id', 'title', 'seo_title', 'seo_keywords', 'seo_description', 'created_at', 'route', 'url']));
$data = $logic->getKeywordInfo();
return $this->success($data);
}
/**
... ...
<?php
/**
* @remark :
* @name :AggregationSettingController.php
* @author :lyh
* @method :post
* @time :2023/10/23 11:06
*/
namespace App\Http\Controllers\Bside\Setting;
use App\Enums\Common\Code;
use App\Helper\Arr;
use App\Http\Controllers\Bside\BaseController;
use App\Models\WebSetting\AggregationSetting;
/**
* @remark :聚合页
* @name :AggregationSettingController
* @author :lyh
* @method :post
* @time :2023/10/23 11:06
*/
class AggregationSettingController extends BaseController
{
/**
* @remark :获取聚合页设置详情
* @name :info
* @author :lyh
* @method :post
* @time :2023/10/23 11:08
*/
public function info(){
$aggSettingModel = new AggregationSetting();
$info = $aggSettingModel->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$data = [
'title'=>'',
'content'=>'',
'top_banner'=>json_encode([]),
'foot_banner'=>json_encode([]),
'project_id'=>$this->user['project_id']
];
$aggSettingModel->add($data);
$info = $data;
}
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :修改聚合页设置
* @name :edit
* @author :lyh
* @method :post
* @time :2023/10/23 11:11
*/
public function edit(){
$aggSettingModel = new AggregationSetting();
if(isset($this->param['top_banner']) && !empty($this->param['top_banner'])){
$this->param['top_banner'] = Arr::a2s($this->param['top_banner']);
}
if(isset($this->param['foot_banner']) && !empty($this->param['foot_banner'])){
$this->param['foot_banner'] = Arr::a2s($this->param['foot_banner']);
}
$rs = $aggSettingModel->edit($this->param,['project_id'=>$this->user['project_id']]);
if($rs === false){
$this->response('系统错误请联系管理员',Code::SYSTEM_ERROR);
}
$this->response('success');
}
}
... ...
... ... @@ -7,6 +7,7 @@ use App\Models\Blog\BlogCategory;
use App\Models\News\NewsCategory;
use App\Models\Product\Category;
use App\Models\Product\Product;
use App\Models\Project\PageSetting;
use App\Models\RouteMap\RouteMap;
use App\Models\Service\Service as ServiceSettingModel;
use App\Models\Template\BTemplateCommon;
... ... @@ -61,12 +62,10 @@ class BTemplateLogic extends BaseLogic
if($info === false){
$this->fail('请先选择模版');
}
$TemplateInfo = [];
if($this->param['source'] == $this->model::SOURCE_HOME){//首页
$TemplateInfo = $this->homeHtml($info,$this->param['source'],$this->param['source_id']);
}
if($this->param['source'] == $this->model::SOURCE_PRODUCT){//产品页
$TemplateInfo = $this->productHtml($info,$this->param['source'],$this->param['source_id']);
}else{
$TemplateInfo = $this->otherHtml($info,$this->param['source'],$this->param['source_id']);
}
return $this->success($TemplateInfo);
}
... ... @@ -105,7 +104,7 @@ class BTemplateLogic extends BaseLogic
$TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]);
}else{
$commonTemplateModel = new BTemplateCommon();
$commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>$source]);
$commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>1]);
if($commonInfo !== false){
$TemplateInfo['html'] = $commonInfo['head_css'].$TemplateInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other'].
$commonInfo['head_html'].$TemplateInfo['main_html'].$commonInfo['footer_html'];
... ... @@ -126,7 +125,7 @@ class BTemplateLogic extends BaseLogic
* @method :post
* @time :2023/7/25 16:40
*/
public function productHtml($info,$source,$source_id){
public function otherHtml($info,$source,$source_id){
$homeTemplateInfo = $this->webTemplateInfo($info['template_id'],1,0);
if($homeTemplateInfo === false){
$this->fail('请先装修首页');
... ... @@ -140,9 +139,7 @@ class BTemplateLogic extends BaseLogic
$main_html = $TemplateInfo['main_html'];
$main_style = $TemplateInfo['main_css'];
}
//兼容老数据
$commonTemplateModel = new BTemplateCommon();
$commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>1]);
$commonInfo = $this->getCommonPage($source,$source_id,$info['template_id']);
if($commonInfo !== false){
$html = $commonInfo['head_css'].$main_style.$commonInfo['footer_css'].$commonInfo['other'].
$commonInfo['head_html'].$main_html.$commonInfo['footer_html'];
... ... @@ -155,6 +152,76 @@ class BTemplateLogic extends BaseLogic
}
/**
* @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();
if ($source == 2) {//产品页
if ($source_id != 0) {//产品详情页
if ($pageInfo['product_list'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 3]);
}
} else {//产品列表页
if ($pageInfo['product_details'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 2]);
}
}
}
if ($source == 3) {//博客页
if ($source_id != 0) {//博客详情页
if ($pageInfo['blog_lists'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 4]);
}
} else {//产品列表页
if ($pageInfo['blog_details'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 5]);
}
}
}
if ($source == 4) {//新闻页
if ($source_id != 0) {//新闻详情页
if ($pageInfo['news_lists'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 6]);
}
} else {//新闻列表页
if ($pageInfo['news_details'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 7]);
}
}
}
if ($source == 5) {//聚合页
if ($pageInfo['polymerization'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 8]);
}
}
}
}
//获取首页公共的头部和底部
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;
}
/**
* @remark :设置模板
* @name :setTemplate
* @author :lyh
... ... @@ -197,6 +264,7 @@ class BTemplateLogic extends BaseLogic
$info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']);
//字符串截取
$this->param = $this->stringProcessing($this->param);
//保存头部信息
$this->saveCommonTemplate($this->param);
$this->param = $this->templateSaveParam($this->param);//组装数据
if($info === false){
... ... @@ -224,8 +292,9 @@ class BTemplateLogic extends BaseLogic
* @time :2023/10/13 14:27
*/
public function saveCommonTemplate($param){
$type = $this->getType($param['source'],$param['source_id']);
$templateCommonModel = new BTemplateCommon();
$info = $templateCommonModel->read(['template_id'=>$param['template_id'],'project_id'=>$this->user['project_id'],'type'=>1]);
$info = $templateCommonModel->read(['template_id'=>$param['template_id'],'project_id'=>$this->user['project_id'],'type'=>$type]);
$data = [
'head_html'=>$param['head_html'],
'head_css'=>$param['head_css'],
... ... @@ -236,7 +305,7 @@ class BTemplateLogic extends BaseLogic
if($info === false){
$data['template_id'] = $param['template_id'];
$data['project_id'] = $this->user['project_id'];
$data['type'] = 1;
$data['type'] = $type;
$templateCommonModel->add($data);
}else{
$templateCommonModel->edit($data,['id'=>$info['id']]);
... ... @@ -245,6 +314,63 @@ class BTemplateLogic extends BaseLogic
}
/**
* @remark :获取设置的类型
* @name :getType
* @author :lyh
* @method :post
* @time :2023/10/21 17:29
*/
public function getType($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_list'] != 0) {
$type = 3;
}
} else {
if ($pageInfo['product_details'] != 0) {
$type = 2;
}
}
}
if ($source == 3) {
if ($source_id != 0) {
if ($pageInfo['blog_list'] != 0) {
$type = 4;
}
} else {
if ($pageInfo['blog_details'] != 0) {
$type = 5;
}
}
}
if ($source == 4) {
if ($source_id != 0) {
if ($pageInfo['news_list'] != 0) {
$type = 6;
}
} else {
if ($pageInfo['news_details'] != 0) {
$type = 7;
}
}
}
if ($source == 5) {
if ($pageInfo['polymerization'] != 0) {
$type = 8;
}
}
}
}
return $type;
}
/**
* @remark :生成记录
* @name :setTemplateLog
* @author :lyh
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Http\Logic\Bside\BTemplate;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Project\PageSetting;
use App\Models\RouteMap\RouteMap;
use App\Models\Service\Service as ServiceSettingModel;
use App\Models\Template\BCustomTemplate;
... ... @@ -109,30 +110,49 @@ class CustomTemplateLogic extends BaseLogic
* @method :post
* @time :2023/10/13 14:27
*/
public function saveCommonTemplate($html){
//获取设置的默认模版
$bSettingModel = new Setting();
$settingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
if($settingInfo === false){
$this->fail('请先设置模版');
}
//查看当前
public function saveCommonTemplate($param){
$type = $this->getType();
$templateCommonModel = new BTemplateCommon();
$commonInfo = $templateCommonModel->read(['template_id'=>$settingInfo['template_id'],'project_id'=>$this->user['project_id']]);
if($commonInfo === false){
$this->fail('请先装修首页');
}
$info = $templateCommonModel->read(['template_id'=>$param['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")),
'head_html'=>$param['head_html'],
'head_css'=>$param['head_css'],
'footer_html'=>$param['footer_html'],
'footer_css'=>$param['footer_css'],
'other'=>str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")),
];
$templateCommonModel->edit($data,['id'=>$commonInfo['id']]);
if($info === false){
$data['template_id'] = $param['template_id'];
$data['project_id'] = $this->user['project_id'];
$data['type'] = $type;
$templateCommonModel->add($data);
}else{
$templateCommonModel->edit($data,['id'=>$info['id']]);
}
return $this->success();
}
/**
* @remark :获取设置的类型
* @name :getType
* @author :lyh
* @method :post
* @time :2023/10/21 17:29
*/
public function getType(){
$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 ($pageInfo['page_list'] != 0) {
$type = 9;
}
}
}
return $type;
}
/**
* @remark :查看路由是否更新
... ... @@ -224,9 +244,8 @@ class CustomTemplateLogic extends BaseLogic
if($info === false){
$this->fail('请先设置模版');
}
$commonTemplateModel = new BTemplateCommon();
$commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id']]);
//获取type类型
$commonInfo = $this->getCommonPage($info['template_id']);
$html = '';
if($commonInfo !== false){
$html = $commonInfo['head_css'].$html_style.$commonInfo['footer_css'].$commonInfo['other'].
... ... @@ -249,6 +268,34 @@ class CustomTemplateLogic extends BaseLogic
}
/**
* @remark :根据类型获取公共头和底
* @name :getCommonPage
* @author :lyh
* @method :post
* @time :2023/10/21 16:55
*/
public function getCommonPage($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();
if ($pageInfo['page_list'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 9]);
}
}
}
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;
}
/**
* @remark :拼接获取公共头部底部
* @name :getHeadFooter
* @author :lyh
... ...
... ... @@ -241,10 +241,12 @@ class CategoryLogic extends BaseLogic
*/
public function categoryDelete(){
$ids = $this->param['ids'];
DB::beginTransaction();
try {
$productModel = new Product();
foreach ($ids as $id){
$info = $this->model->read(['pid'=>$id],['id']);
if($info !== false){
$this->fail('分类id:'.$id.'拥有子集不允许删除');
}
$productModel = new Product();
$product_info = $productModel->read(['category_id'=>['like','%,'.$id.',%']]);
if($product_info !== false){
$this->fail('当前分类拥有产品不允许删除');
... ... @@ -255,11 +257,6 @@ class CategoryLogic extends BaseLogic
}
//清除缓存
Common::del_user_cache('product_category',$this->user['project_id']);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('删除失败');
}
return $this->success();
}
... ...
... ... @@ -34,9 +34,9 @@ class KeywordLogic extends BaseLogic
* @method :post
* @time :2023/8/23 16:50
*/
public function getInfo($id)
public function getKeywordInfo()
{
$info = parent::getInfo($id);
$info = $this->model->read($this->param);
$info['url'] = $this->user['domain'] . $info['route'];
return $this->success($info);
}
... ... @@ -51,6 +51,7 @@ class KeywordLogic extends BaseLogic
public function keywordSave(){
DB::beginTransaction();
try {
$this->param = $this->handleSaveParam($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$info = $this->model->read(['id'=>$this->param['id']],['id','route']);
$route = $info['route'];
... ... @@ -77,6 +78,23 @@ class KeywordLogic extends BaseLogic
}
/**
* @remark :保存数据时参数处理
* @name :handleSaveParam
* @author :lyh
* @method :post
* @time :2023/10/23 14:47
*/
public function handleSaveParam($param){
if(isset($param['keyword_top_banner']) && !empty($param['keyword_top_banner'])){
$param['keyword_top_banner'] = str_replace_url($param['keyword_top_banner']);
}
if(isset($param['keyword_foot_banner']) && !empty($param['keyword_foot_banner'])){
$param['keyword_foot_banner'] = str_replace_url($param['keyword_foot_banner']);
}
return $param;
}
/**
* @remark :批量添加数据
* @name :batchAdd
* @author :lyh
... ...
... ... @@ -2,6 +2,7 @@
namespace App\Models\Product;
use App\Helper\Arr;
use App\Models\Base;
use Illuminate\Database\Eloquent\SoftDeletes;
... ... @@ -19,4 +20,26 @@ class Keyword extends Base
// public function getRouteAttribute(){
// return RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $this->id, $this->project_id);
// }
/**
* @remark :图
* @name :getKeywordTopBannerAttribute
* @author :lyh
* @method :post
* @time :2023/7/21 11:11
*/
public function getKeywordTopBannerAttribute($value){
return getImageUrl($value);
}
/**
* @remark :图
* @name :getKeywordTopBannerAttribute
* @author :lyh
* @method :post
* @time :2023/7/21 11:11
*/
public function getKeywordFootBannerAttribute($value){
return getImageUrl($value);
}
}
... ...
<?php
/**
* @remark :
* @name :PageSetting.php
* @author :lyh
* @method :post
* @time :2023/10/21 15:24
*/
namespace App\Models\Project;
use App\Models\Base;
/**
* @remark :项目页面头部底部设置
* @name :PageSetting
* @author :lyh
* @method :post
* @time :2023/10/21 15:24
*/
class PageSetting extends Base
{
protected $table = 'gl_project_page_setting';
}
... ...
<?php
/**
* @remark :
* @name :AggregationSetting.php
* @author :lyh
* @method :post
* @time :2023/10/23 10:45
*/
namespace App\Models\WebSetting;
use App\Helper\Arr;
use App\Models\Base;
/**
* @remark :产品关键字聚合页设置
* @name :AggregationSetting
* @author :lyh
* @method :post
* @time :2023/10/23 10:48
*/
class AggregationSetting extends Base
{
//设置关联表名
protected $table = 'gl_aggregation_setting';
/**
* @remark :顶部banner获取器
* @name :getGalleryAttribute
* @author :lyh
* @method :post
* @time :2023/7/21 11:11
*/
public function getTopBannerAttribute($value){
if(!empty($value)){
$value = Arr::s2a($value);
foreach ($value as $k => $v){
$v = getImageUrl($v);
$value[$k] = $v;
}
}
return $value;
}
/**
* @remark :底部banner获取器
* @name :getGalleryAttribute
* @author :lyh
* @method :post
* @time :2023/7/21 11:11
*/
public function getFootBannerAttribute($value){
if(!empty($value)){
$value = Arr::s2a($value);
foreach ($value as $k => $v){
$v = getImageUrl($v);
$value[$k] = $v;
}
}
return $value;
}
}
... ...
... ... @@ -26,7 +26,11 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/role_list', [\App\Http\Controllers\Bside\User\UserController::class, 'role_list'])->name('user_role_list');
Route::any('/del', [\App\Http\Controllers\Bside\User\UserController::class, 'del'])->name('user_del');
});
//项目独立头部和底部设置
Route::prefix('pageSetting')->group(function () {
Route::any('/info', [\App\Http\Controllers\Bside\BCom\PageSettingController::class, 'info'])->name('pageSetting_info');
Route::any('/edit',[\App\Http\Controllers\Bside\BCom\PageSettingController::class, 'edit'])->name('pageSetting_edit');
});
//站内信
Route::prefix('mail')->group(function () {
Route::any('/', [\App\Http\Controllers\Bside\Mail\MailController::class, 'lists'])->name('mail_lists');
... ... @@ -178,6 +182,12 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingImageController::class, 'save'])->name('web_image_save');
});
//聚合页相关配置
Route::prefix('aggregation')->group(function () {
Route::any('/info', [\App\Http\Controllers\Bside\Setting\AggregationSettingController::class, 'info'])->name('aggregation_info');
Route::any('/edit',[\App\Http\Controllers\Bside\Setting\AggregationSettingController::class, 'edit'])->name('aggregation_edit');
});
});
//产品
Route::prefix('product')->group(function () {
... ...