作者 lyh

gx

... ... @@ -96,6 +96,7 @@ class OptimizeController extends BaseController
$select = [
'gl_project.id AS id',
'gl_project.title AS title',
'gl_project_online_check.level AS level',
'gl_project.channel AS channel',
'gl_project.company AS company',
'gl_project.type AS type',
... ... @@ -111,6 +112,7 @@ class OptimizeController extends BaseController
'gl_project_online_check.go_question AS go_question',
'gl_project_online_check.optimist_status AS optimist_status',
'gl_project_online_check.qa_status AS qa_status',
'gl_project_online_check.created_at AS online_created_at',
'gl_project_payment.amount AS amount',
'gl_project_deploy_build.dept_id AS dept_id',
'gl_project_deploy_build.keyword_num AS key',
... ... @@ -148,6 +150,9 @@ class OptimizeController extends BaseController
if(isset($this->map['title']) && !empty($this->map['title'])){
$query = $query->where('gl_project.title','like','%'.$this->map['title'].'%');
}
if(isset($this->map['level']) && !empty($this->map['level'])){
$query = $query->whereRaw("FIND_IN_SET(?, gl_project.level) > 0", [$this->map['level']]);
}
if(isset($this->map['special']) && !empty($this->map['special'])){
$query = $query->where('gl_project_deploy_optimize.special','like','%'.$this->map['special'].'%');
}
... ...
... ... @@ -389,13 +389,11 @@ class ProjectController extends BaseController
/**
* 数据源
* @param ProjectLogic $logic
* @return \Illuminate\Http\JsonResponse
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @author zbj
* @date 2023/6/20
* @remark :项目相关数据
* @name :data_source
* @author :lyh
* @method :post
* @time :2023/12/7 10:41
*/
public function data_source(ProjectLogic $logic){
$data = $logic->dataSource();
... ...
... ... @@ -117,6 +117,8 @@ class CustomModuleCategoryLogic extends BaseLogic
$this->addUpdateNotify(RouteMap::SOURCE_MODULE_CATE.$this->param['module_id'],$route);
$this->curlDelRoute(['new_route'=>$route]);
$this->edit(['url' => $route], ['id' => $id]);
//处理上级分类商品
$this->handleAddSon($id);
}catch (\Exception $e){
$this->fail('系统错误,请联系管理员');
}
... ... @@ -142,6 +144,32 @@ class CustomModuleCategoryLogic extends BaseLogic
}
/**
* @remark :编辑分类,处理博客数据
* @name :editCategory
* @author :lyh
* @method :post
* @time :2023/10/20 9:32
*/
public function editHandleCategory($id,$pid){
$info = $this->model->read(['id'=>$id],['id','pid']);
if($info['pid'] != $pid){
//修改勒上级,先查看上级是否拥有博客
$contentModel = new CustomModuleContent();
$newsCount = $contentModel->formatQuery(['category_id'=>['like','%,'.$pid.',%']])->count();
//随机获取最后一级id
$replacement = $this->getLastId($id);
if($newsCount > 0){
//存在博客时,移动所有博客到当前分类最后一级
$newsCount->where('category_id', 'like', '%,' . $pid . ',%')->where('category_id', 'like', '%,' . $replacement . ',%')
->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',')")]);
$newsCount->where('category_id', 'like', '%,' . $pid . ',%')
->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',$replacement,')")]);
}
}
return $this->success();
}
/**
* @remark :查看是否编辑路由
* @name :editCategoryRoute
* @author :lyh
... ...
... ... @@ -87,9 +87,9 @@ class NewsCategoryLogic extends BaseLogic
$replacement = $this->getLastId($id);
if($newsCount > 0){
//存在博客时,移动所有博客到当前分类最后一级
$newsCount->where('category_id', 'like', '%,' . $pid . ',%')->where('category_id', 'like', '%,' . $replacement . ',%')
$newsModel->where('category_id', 'like', '%,' . $pid . ',%')->where('category_id', 'like', '%,' . $replacement . ',%')
->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',')")]);
$newsCount->where('category_id', 'like', '%,' . $pid . ',%')
$newsModel->where('category_id', 'like', '%,' . $pid . ',%')
->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',$replacement,')")]);
}
}
... ...