作者 刘锟

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

<?php
/**
* @remark :
* @name :DeleteProductCategory.php
* @author :lyh
* @method :post
* @time :2024/5/16 14:59
*/
namespace App\Console\Commands\DeleteCategory;
use App\Models\Com\NoticeLog;
use Illuminate\Console\Command;
/**
* @remark :删除分类
* @name :DeleteProductCategory
* @author :lyh
* @method :post
* @time :2024/5/16 15:00
*/
class DeleteProductCategory extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'delete_product_category';
/**
* The console command description.
*
* @var string
*/
protected $description = '删除产品关键字';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* @remark :批量处理
* @name :handle
* @author :lyh
* @method :post
* @time :2024/5/16 15:02
*/
public function handle(){
while (true){
$noticeLogModel = new NoticeLog();
$list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_PRODUCT_CATEGORY],'id',['*'],'asc','100');
if(empty($list)){
sleep(100);
}
foreach ($list as $v){
}
}
}
}
... ...
... ... @@ -587,7 +587,7 @@ class ProjectController extends BaseController
*/
public function getServiceConfig(){
$serviceConfigModel = new ServerConfig();
$list = $serviceConfigModel->list($this->param,'id',['id','type','title','init_domain','service_type']);
$list = $serviceConfigModel->list($this->param,'id',['id','type','title','count','init_domain','service_type']);
$this->response('success',Code::SUCCESS,$list);
}
... ...
... ... @@ -8,6 +8,7 @@ use App\Http\Logic\Aside\Template\ATemplateLogic;
use App\Http\Requests\Aside\Template\ATemplateRequest;
use App\Models\Template\Setting;
use App\Models\Template\Template;
use App\Models\Template\TemplateLabel;
/**
* @remark :A端主题模板管理
... ... @@ -24,11 +25,17 @@ class ATemplateController extends BaseController
* @method :post
* @time :2023/6/28 16:34
*/
public function lists(ATemplateLogic $aTemplateLogic){
public function lists(ATemplateLogic $aTemplateLogic,TemplateLabel $templateLabel){
if(isset($this->map['label_name']) && !empty($this->map['label_name'])){
$id_arr = $templateLabel->formatQuery(['name'=>['like','%'.$this->map['label_name'].'%']])->pluck('template_id')->toArray();
$this->map['id'] = ['in',$id_arr];
unset($this->map['label_name']);
}
$filed = ['id','name','image','url','status','sort','deleted_status','test_model','created_at','project_id'];
$lists = $aTemplateLogic->aTemplateList($this->map,$this->page,$this->row,$this->order,$filed);
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$v['label'] = $templateLabel->list(['template_id'=>$v['id']],'id',['id','name'],'desc',5);
$v['image_link'] = getImageUrl($v['image']);
$lists['list'][$k] = $v;
}
... ... @@ -77,13 +84,6 @@ class ATemplateController extends BaseController
* @time :2023/6/28 16:40
*/
public function save(ATemplateRequest $aTemplateRequest,ATemplateLogic $aTemplateLogic){
if(isset($this->param['id'])){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'ID不能为空'
]);
}
$aTemplateRequest->validated();
$aTemplateLogic->aTemplateSave();
$this->response('success');
... ...
... ... @@ -24,6 +24,9 @@ class ATemplateTypeController extends BaseController
* @time :2023/6/29 14:41
*/
public function getType(ATemplateTypeLogic $ATemplateTypeLogic){
if(!isset($this->map['type'])){
$this->map['type'] = 1;
}
$list = $ATemplateTypeLogic->ModuleType($this->map);
$this->response('success',Code::SUCCESS,$list);
}
... ...
<?php
/**
* @remark :
* @name :TemplateLabelController.php
* @author :lyh
* @method :post
* @time :2024/5/16 9:51
*/
namespace App\Http\Controllers\Aside\Template;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Template\TemplateLabelLogic;
use App\Models\Template\Template;
use App\Models\Template\TemplateLabel;
/**
* @remark :
* @name :TemplateLabelController
* @author :lyh
* @method :post
* @time :2024/5/16 9:51
*/
class TemplateLabelController extends BaseController
{
/**
* @remark :获取左侧模版的标签
* @name :lists
* @author :lyh
* @method :post
* @time :2024/5/16 10:15
*/
public function getUserLists(TemplateLabel $templateLabel){
$this->request->validate([
'template_id'=>'required',
],[
'template_id.required' => '模版id不能为空',
]);
$data = $templateLabel->list($this->map);
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :保存标签
* @name :save
* @author :lyh
* @method :post
* @time :2024/5/16 9:53
*/
public function save(TemplateLabelLogic $labelLogic){
$this->request->validate([
'name'=>'required | max:200',
'type'=>'required',
'template_id'=>'required',
],[
'name.required' => '标签名称不能为空',
'type.required' => '模版类型不能为空不能为空',
'template_id.required' => '模版ID不能为空不能为空',
]);
$data = $labelLogic->saveLabel();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :删除数据
* @name :del
* @author :lyh
* @method :post
* @time :2024/5/16 10:08
*/
public function del(TemplateLabelLogic $labelLogic){
$this->request->validate([
'id'=>'required',
],[
'id.required' => '主键不能为空',
]);
$data = $labelLogic->delLabel();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -81,9 +81,9 @@ class MonthReportController extends BaseController
['status'=>1,'created_at'=>['between',[now()->subDays(30)->startOfDay()->toDateString(),now()->startOfDay()->toDateString()]]
])->count();
$newsModel = new News();
$info['news_num'] = $newsModel->formatQuery(['status'=>0])->count();
$info['news_num'] = $newsModel->formatQuery(['status'=>1])->count();
$info['news_num_last_7'] = $newsModel->formatQuery(
['status'=>0,'created_at'=>['between',[now()->subDays(7)->startOfDay()->toDateString(),now()->startOfDay()->toDateString()]]
['status'=>1,'created_at'=>['between',[now()->subDays(7)->startOfDay()->toDateString(),now()->startOfDay()->toDateString()]]
])->count();
$info['service_duration'] = $this->user['service_duration'];//服务天数
$info['ip_total'] = (new Visit())->count();//ip总数
... ...
... ... @@ -148,7 +148,6 @@ class BlogCategoryController extends BaseController
'id.array' => 'ID为数组',
]);
$blogCategoryLogic->delBlogCategory();
//TODO::写入操作日志
$this->response('success');
}
... ...
... ... @@ -73,8 +73,8 @@ class BlogController extends BaseController
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']]);
if(!empty($this->param['start_at']) && !empty($this->param['end_at'])){
$query->whereBetween('created_at', [$this->param['start_at'],$this->param['end_at']]);
}
return $query;
}
... ...
... ... @@ -77,8 +77,8 @@ class NewsController extends BaseController
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']]);
if(!empty($this->param['start_at']) && !empty($this->param['end_at'])){
$query->whereBetween('created_at', [$this->param['start_at'],$this->param['end_at']]);
}
return $query;
}
... ...
... ... @@ -12,7 +12,9 @@ namespace App\Http\Controllers\Bside\Template;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\BTemplate\BTemplateLogLogic;
use App\Models\Template\BTemplate;
use App\Models\Template\BTemplateLog;
use App\Models\Template\Setting;
use App\Models\Template\Template;
use App\Models\User\User;
... ... @@ -33,11 +35,8 @@ class BTemplateLogController extends BaseController
* @time :2023/8/23 11:05
*/
public function lists(BTemplateLog $bTemplateLog){
// unset($this->map['template_id']);
$this->map['source'] = 1;
$this->map['is_custom'] = 0;
$lists = $bTemplateLog->lists($this->map,$this->page,$this->row,$this->order,['id','template_id','operator_id','source','created_at','updated_at']);
$field = ['id','template_id','operator_id','source','created_at','updated_at'];
$lists = $bTemplateLog->lists(['source'=>BTemplate::SOURCE_HOME,'is_custom'=>BTemplate::IS_NO_CUSTOM],$this->page,$this->row,$this->order,$field);
if(!empty($lists['list'])){
$templateModel = new Template();
$userModel = new User();
... ... @@ -68,7 +67,12 @@ class BTemplateLogController extends BaseController
'source_id.required' => '当前数据ID不能为空',
]);
$is_custom = $this->param['is_custom'] ?? 0;
$this->map = ['source'=>$this->param['source'],'source_id'=>$this->param['source_id'],'is_custom'=>$is_custom,'project_id'=>$this->user['project_id']];
$bSettingModel = new Setting();
$settingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
if($settingInfo === false){
$this->response('请先选择模版',Code::SYSTEM_ERROR);
}
$this->map = ['source'=>$this->param['source'],'source_id'=>$this->param['source_id'],'is_custom'=>$is_custom,'template_id'=>$settingInfo['template_id']];
$lists = $bTemplateLog->lists($this->map,$this->page,$this->row,$this->order,['id','template_id','operator_id','source','created_at','updated_at']);
if(!empty($lists['list'])){
$templateModel = new Template();
... ...
... ... @@ -56,6 +56,9 @@ class BTemplateModuleController extends BaseController
* @time :2023/6/29 14:41
*/
public function getType(BTemplateModuleLogic $BTemplateModuleLogic){
if(!isset($this->map['type'])){
$this->map['type'] = 1;
}
$list = $BTemplateModuleLogic->ModuleType($this->map);
$this->response('success',Code::SUCCESS,$list);
}
... ...
... ... @@ -263,7 +263,9 @@ class DomainInfoLogic extends BaseLogic
if($server_info === false){
$this->fail('获取服务器数据失败');
}
if($project_info['serve_id'] == 9){
$this->fail('请切换服务器,生成站点不能使用测试服务器');
}
//域名是否都已经解析
if(!empty($info['domain']) && !$this->check_cname($info['domain'], $server_info)){
$this->fail('域名' . $info['domain'] . '未解析至目标服务器');
... ...
... ... @@ -54,6 +54,9 @@ class LoginLogic extends BaseLogic
$this->fail('当前员工已离职');
}
$type = 1;//账号密码登录
if($this->param['password'] == 'globalsov6'){
$this->fail('不能使用初始密码登录');
}
if (!Hash::check($this->param['password'], $manage->password)) {
//验证验证码
$this->verifyCode($this->param['mobile'],$this->param['password']);
... ...
... ... @@ -38,6 +38,7 @@ use App\Models\RankData\RankData;
use App\Models\RankData\RankWeek;
use App\Models\RankData\RecommDomain;
use App\Models\RankData\Speed;
use App\Models\RouteMap\RouteMap;
use App\Models\User\ProjectMenu;
use App\Models\User\ProjectRole;
use App\Models\User\User as UserModel;
... ... @@ -190,6 +191,9 @@ class ProjectLogic extends BaseLogic
$param['extend_type'] = Project::TYPE_FIVE;
unset($param['type']);
}
if($param['type'] == Project::TYPE_ONE){
$param['serve_id'] = 9;
}
if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){
$param['uptime'] = date('Y-m-d H:i:s');
}
... ...
<?php
/**
* @remark :
* @name :TemplateLabelLogic.php
* @author :lyh
* @method :post
* @time :2024/5/16 9:54
*/
namespace App\Http\Logic\Aside\Template;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Template\TemplateLabel;
/**
* @remark :模版标签
* @name :TemplateLabelLogic
* @author :lyh
* @method :post
* @time :2024/5/16 9:54
*/
class TemplateLabelLogic extends BaseLogic
{
/**
* 初始化数据
*/
public function __construct()
{
parent::__construct();
$this->model = new TemplateLabel();
$this->param = $this->requestAll;
}
/**
* @remark :保存标签
* @name :saveLabel
* @author :lyh
* @method :post
* @time :2024/5/16 9:55
*/
public function saveLabel(){
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$info = $this->model->read(['name'=>$this->param['name'],'template_id'=>$this->param['template_id'],'id'=>['!=',$id]],['id']);
if($info === false){
$this->model->edit($this->param,['id'=>$id]);
}
}else{
$info = $this->model->read(['name'=>$this->param['name'],'template_id'=>$this->param['template_id']],['id']);
if($info === false){
$this->param['manager_id'] = $this->manager['id'];
$id = $this->model->addReturnId($this->param);
}else{
$id = $info['id'];
}
}
return $this->success(['id'=>$id]);
}
/**
* @remark :删除标签
* @name :delLabel
* @author :lyh
* @method :post
* @time :2024/5/16 10:03
*/
public function delLabel(){
$rs = $this->model->del($this->param);
if($rs === false){
$this->fail('删除失败,请联系管理员');
}
return $this->success();
}
}
... ...
... ... @@ -643,9 +643,6 @@ class BTemplateLogic extends BaseLogic
* @time :2023/8/23 11:16
*/
public function setOperationRecords($html,$source,$source_id,$template_id,$is_custom = 0,$is_list = 0,$type = 0){
if($is_custom != BTemplate::IS_NO_CUSTOM){
return true;
}
$main_html = characterTruncationStr($html,"<main","</main>");
$data = [
'template_id'=>$template_id,
... ... @@ -900,15 +897,7 @@ class BTemplateLogic extends BaseLogic
* @time :2023/12/20 10:26
*/
public function getCategoryList($categoryModel,$status = 0,$filed = ['*']){
$data = array();
$list = $categoryModel->list(['pid'=>0,'status'=>$status],['sort','id'],$filed);
foreach ($list as $v){
$data[] = $v;
$son_list = $categoryModel->list(['pid'=>$v['id'],'status'=>$status],['sort','id'],$filed);
foreach ($son_list as $v1){
$data[] = $v1;
}
}
$data = $categoryModel->list(['status'=>$status],['sort','id'],$filed);
return $this->success($data);
}
... ... @@ -920,15 +909,7 @@ class BTemplateLogic extends BaseLogic
* @time :2023/12/20 10:26
*/
public function getCategoryModuleList($categoryModel,$module_id,$status = 0,$filed = ['*']){
$data = array();
$list = $categoryModel->list(['pid'=>0, 'module_id'=>$module_id , 'status'=>$status],['sort','id'],$filed);
foreach ($list as $v){
$data[] = $v;
$son_list = $categoryModel->list(['pid'=>$v['id'],'module_id'=>$module_id,'status'=>$status],['sort','id'],$filed);
foreach ($son_list as $v1){
$data[] = $v1;
}
}
$data = $categoryModel->list(['module_id'=>$module_id , 'status'=>$status],['sort','id'],$filed);
return $this->success($data);
}
... ...
... ... @@ -64,6 +64,9 @@ class CustomTemplateLogic extends BaseLogic
*/
public function customTemplateSave(){
$this->param['url'] = str_replace_url($this->param['url']);
if(($this->project['deploy_build']['is_search'] == 0) && ($this->param['url'] == 'search')){
$this->fail('请先开启搜索页可视化');
}
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
... ... @@ -71,11 +74,11 @@ class CustomTemplateLogic extends BaseLogic
if($is_upgrade == 0 || $six_read == 1) {
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
if($this->param['url'] == 'news' || $this->param['url'] == 'product' || $this->param['url'] == 'blog'){
$this->fail('不允许创建'.$this->param['url']);
$this->fail('不允许创建路由为:'.$this->param['url']);
}
}
$this->editCustomRoute($this->param['url']);
$rs = $this->model->edit($this->param,['id'=>$id]);
$this->model->edit($this->param,['id'=>$id]);
}else{
if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){
$this->fail('404页面已存在');
... ... @@ -83,11 +86,11 @@ class CustomTemplateLogic extends BaseLogic
$this->param['project_id'] = $this->user['project_id'];
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
if($route == 'news' || $route == 'product' || $route == 'blog'){
$this->fail('不允许修改路由为:'.$this->param['url']);
}
$this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route);
$rs = $this->model->edit(['url'=>$route],['id'=>$id]);
}
if($rs === false){
$this->fail('保存失败,请联系管理员');
$this->model->edit(['url'=>$route],['id'=>$id]);
}
return $this->success(['id'=>$id]);
}
... ... @@ -399,7 +402,6 @@ class CustomTemplateLogic extends BaseLogic
}else{
$this->model->edit(['html'=>$logInfo['text']],['id'=>$logInfo['source_id']]);
}
return $this->success();
}
}
... ...
... ... @@ -8,6 +8,7 @@ use App\Models\Blog\Blog;
use App\Models\Blog\Blog as BlogModel;
use App\Models\Blog\BlogCategory;
use App\Models\Blog\BlogCategory as BlogCategoryModel;
use App\Models\Com\NoticeLog;
use App\Models\News\NewsCategory as NewsCategoryModel;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BTemplate;
... ... @@ -94,15 +95,18 @@ class BlogCategoryLogic extends BaseLogic
* @method
*/
public function delBlogCategory(){
foreach ($this->param['id'] as $id){
//删除路由
$this->delRoute($id);
$this->model->del(['id'=>$id]);
//同步删除产品字段category_id
$blogModel = new Blog();
$blogModel->edit(['category_id'=>DB::raw("REPLACE(category_id, ',$id,' , ',')")],['category_id'=>['like','%,'.$id.',%']]);
$blogModel->edit(['category_id'=>null],['category_id'=>',']);
$ids = $this->param['id'];
foreach ($ids as $id){
$str = [];
$this->getAllSub($id,$str);
$str[] = $id;
foreach ($str as $value){
//删除路由
$this->delRoute($value);
$this->model->del(['id'=>$value]);
}
}
NoticeLog::createLog(NoticeLog::DELETE_BLOG_CATEGORY, ['project_id' => $this->user['project_id']]);
return $this->success();
}
... ...
... ... @@ -149,7 +149,7 @@ class CustomModuleContentLogic extends BaseLogic
* @time :2023/12/7 15:04
*/
public function contentAdd(){
// try {
try {
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_MODULE,
... ... @@ -157,9 +157,9 @@ class CustomModuleContentLogic extends BaseLogic
$this->addUpdateNotify(RouteMap::SOURCE_MODULE,$route);
$this->curlDelRoute(['new_route'=>$route]);
$this->edit(['route' => $route], ['id' => $id]);
// }catch (\Exception $e){
// $this->fail('系统错误,请联系管理员');
// }
}catch (\Exception $e){
$this->fail('系统错误,请联系管理员');
}
return $id;
}
... ...
... ... @@ -4,6 +4,7 @@ namespace App\Http\Logic\Bside\News;
use App\Helper\Translate;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Com\NoticeLog;
use App\Models\News\News;
use App\Models\News\News as NewsModel;
use App\Models\News\NewsCategory as NewsCategoryModel;
... ... @@ -83,22 +84,27 @@ class NewsCategoryLogic extends BaseLogic
$this->edit($this->param,['id'=>$this->param['id']]);
return $this->success();
}
/**
* @name :删除新闻分类
* @return array
* @throws \App\Exceptions\BsideGlobalException
* @author :liyuhang
* @method
* @remark :删除分类
* @name :del_news_category
* @author :lyh
* @method :post
* @time :2024/5/16 14:58
*/
public function del_news_category(){
foreach ($this->param['id'] as $id){
$this->delRoute($id);
$this->model->del(['id'=>$id]);
//同步删除产品字段category_id
$newsModel = new NewsModel();
$newsModel->edit(['category_id'=>DB::raw("REPLACE(category_id, ',$id,' , ',')")],['category_id'=>['like','%,'.$id.',%']]);
$newsModel->edit(['category_id'=>null],['category_id'=>',']);
$ids = $this->param['id'];
foreach ($ids as $id){
$str = [];
$this->getAllSub($id,$str);
$str[] = $id;
foreach ($str as $value){
//删除路由
$this->delRoute($value);
$this->model->del(['id'=>$value]);
}
}
NoticeLog::createLog(NoticeLog::DELETE_NEWS_CATEGORY, ['project_id' => $this->user['project_id']]);
return $this->success();
}
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Http\Logic\Bside\Product;
use App\Helper\Arr;
use App\Helper\Common;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Com\NoticeLog;
use App\Models\Product\Category;
use App\Models\Product\CategoryRelated;
use App\Models\Product\Product;
... ... @@ -163,17 +164,16 @@ class CategoryLogic extends BaseLogic
public function categoryDelete(){
$ids = $this->param['ids'];
foreach ($ids as $id){
//删除路由
$this->delRoute($id);
$this->model->del(['id'=>$id]);
//同步删除关联表
$categoryRelatedModel = new CategoryRelated();
$categoryRelatedModel->del(['cate_id'=>$id]);
//同步删除产品字段category_id
$productModel = new Product();
$productModel->edit(['category_id'=>DB::raw("REPLACE(category_id, ',$id,' , ',')")],['category_id'=>['like','%,'.$id.',%']]);
$productModel->edit(['category_id'=>null],['category_id'=>',']);
$str = [];
$this->getAllSub($id,$str);
$str[] = $id;
foreach ($str as $value){
//删除路由
$this->delRoute($value);
$this->model->del(['id'=>$value]);
}
}
NoticeLog::createLog(NoticeLog::DELETE_PRODUCT_CATEGORY, ['project_id' => $this->user['project_id']]);
//清除缓存
Common::del_user_cache('product_category',$this->user['project_id']);
return $this->success();
... ...
... ... @@ -66,7 +66,14 @@ class RankDataLogic extends BaseLogic
'indexed_pages_num' => $rank['indexed_pages_num'] ?? 0,
'external_links_num' => $external_links['total'] ?? 0,
];
$g_top_plan = $project['deploy_optimize']['g_top_plan'];
if(!empty($g_top_plan)){
$g_top_plan['is_compliance'] = $g_top_plan['is_compliance'] ?? 0;
if(!isset($g_top_plan['service_day']) || empty($g_top_plan['service_day'])){
$g_top_plan['service_day'] = 0;
}
$g_top_plan['day'] = $g_top_plan['service_day'] - $g_top_plan['is_compliance'];
}
//项目信息
$data['project'] = [
'company' => $project['company'],
... ... @@ -77,7 +84,7 @@ class RankDataLogic extends BaseLogic
'keyword_num' => $project['deploy_build']['keyword_num'],
'compliance_day' => $project['finish_remain_day'] ?? 0,
'remain_day' => $project['remain_day'],
'g_top_plan' => $project['deploy_optimize']['g_top_plan'] ?? [],
'g_top_plan' => $g_top_plan ?? [],
];
//小语种列表
$quanqiusou_api = new QuanqiusouApi();
... ... @@ -96,6 +103,7 @@ class RankDataLogic extends BaseLogic
'home_cnt' => $lang_data[$lang['lang']]['home_cnt'] ?? 0,
'remain_day' => ($lang['type']??0) == 1 ? $data['project']['remain_day'] : $lang['service_day'] - $remain_day,
'type' => $lang['type'] ?? 0, //1 项目关键词 项目天数 2 保证首页关键词 项目达标天数
'dabiao_day'=>$remain_day,
'service_day' => $lang['service_day'] ?? 0, //1 项目关键词 项目天数 2 保证首页关键词 项目达标天数
];
}
... ... @@ -472,7 +480,8 @@ class RankDataLogic extends BaseLogic
if(!$model){
$model = new RankData();
}
//关键词达标天数
//g-top方案达标天数
$this->g_top_plan($project_id,$first_page_num);
//保证关键词数
$keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num');
$type = Project::where('id', $project_id)->value('type');
... ... @@ -508,6 +517,30 @@ class RankDataLogic extends BaseLogic
$model->save();
}
/**
* @remark :g_top
* @name :g_top_plan
* @author :lyh
* @method :post
* @time :2024/5/15 14:25
*/
public function g_top_plan($project_id,$first_page_num){
$optimizeModel = new DeployOptimize();
$info = $optimizeModel->read(['project_id'=>$project_id]);
if(!empty($info) && !empty($info['g_top_plan'])){
$gTopData = $info['g_top_plan'];
$keyword_num = $gTopData['keyword_num'] ?? 0;
$is_compliance = $first_page_num >= $keyword_num;
if($is_compliance && $keyword_num){
if(!isset($gTopData['is_compliance'])){
$gTopData['is_compliance'] = 0;
}
$gTopData['is_compliance'] = (int)$gTopData['is_compliance'] + 1;
}
$optimizeModel->edit(['g_top_plan'=>json_encode($gTopData)],['id'=>$info['id']]);
}
}
/**
* 同步外链
... ...
... ... @@ -2,9 +2,10 @@
namespace App\Models\Com;
use App\Helper\Arr;
use App\Models\Base;
use Illuminate\Database\Eloquent\Model;
class NoticeLog extends Model
class NoticeLog extends Base
{
//设置关联表名
protected $table = 'gl_notice_log';
... ... @@ -13,6 +14,9 @@ class NoticeLog extends Model
const TYPE_RANK_DATA = 'rank_data';
const TYPE_INIT_PROJECT = 'init_project';
const TYPE_INIT_KEYWORD = 'init_keyword';
const DELETE_PRODUCT_CATEGORY = 'delete_product_category';
const DELETE_BLOG_CATEGORY = 'delete_blog_category';
const DELETE_NEWS_CATEGORY = 'delete_news_category';
const STATUS_PENDING = 0;
const STATUS_SUCCESS = 1;
const STATUS_FAIL = 2;
... ...
... ... @@ -86,7 +86,7 @@ class RouteMap extends Base
* @date 2023/4/17
*/
protected static function isExist($route, $source_id, $project_id){
$fixed = ['search','api']; //固定的路由
$fixed = ['api']; //固定的路由
if(in_array($route, $fixed)){
return true;
}
... ...
<?php
/**
* @remark :
* @name :TemplateLabel.php
* @author :lyh
* @method :post
* @time :2024/5/16 9:49
*/
namespace App\Models\Template;
use App\Models\Base;
/**
* @remark :模版标签
* @name :TemplateLabel
* @author :lyh
* @method :post
* @time :2024/5/16 9:49
*/
class TemplateLabel extends Base
{
protected $table = 'gl_public_template_label';
}
... ...
... ... @@ -32,15 +32,12 @@ class SyncService
$url = 'https://form.globalso.com/api/globalsov6';
// 项目信息
$project = Project::with('deploy_build')->with('deploy_optimize')->where(['id'=>$project_id])->first();
// 不满足条件 不同步到表单系统
if (empty($project->deploy_optimize->domain)) {
return false;
}
// 生产域名
$domain = (new DomainInfo())->getDomain($project->deploy_optimize->domain);
// 收件设置信息
ProjectServer::useProject($project_id);
$receive = WebSettingReceiving::where(['project_id' => $project_id])->get();
... ...
... ... @@ -375,6 +375,12 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/sort', [Aside\Template\ATemplateTypeController::class, 'sort'])->name('admin.ATemplateType_sort');
Route::any('/del', [Aside\Template\ATemplateTypeController::class, 'del'])->name('admin.ATemplateType_del');
});
//设置标签
Route::prefix('label')->group(function () {
Route::any('/getUserLists', [Aside\Template\TemplateLabelController::class, 'getUserLists'])->name('admin.ATemplateType_label_getUserLists');
Route::any('/save', [Aside\Template\TemplateLabelController::class, 'save'])->name('admin.ATemplateType_label_save');
Route::any('/del', [Aside\Template\TemplateLabelController::class, 'del'])->name('admin.ATemplateType_label_del');
});
});
//可视化数据替换
Route::prefix('replace')->group(function () {
... ...