作者 lyh

gx

... ... @@ -26,7 +26,7 @@ class NewsController extends BaseController
* @method
*/
public function lists(NewsModel $news){
$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','image','updated_at','name','sort','url'];
$this->order = 'sort';
$query = $news->orderBy($this->order ,'desc');
$query = $this->searchParam($query);
... ...
... ... @@ -73,7 +73,7 @@ class ProductController extends BaseController
* @method :post
* @time :2023/9/14 10:01
*/
public function searchParams(&$query){
public function searchParam(&$query){
$query = $query->where('project_id',$this->user['project_id']);
if (isset($this->map['category_id']) && !empty($this->map['category_id'])) {
$str = [];
... ... @@ -84,6 +84,9 @@ class ProductController extends BaseController
}
});
}
if(isset($this->map['title']) && !empty($this->map['title'])){
$query = $query->where('title','like','%'.$this->map['title'].'%');
}
if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){
$query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]);
}
... ... @@ -91,21 +94,6 @@ class ProductController extends BaseController
}
/**
* @remark :搜索参数处理
* @name :searchParam
* @author :lyh
* @method :post
* @time :2023/9/14 14:32
*/
public function searchParam(){
if(isset($this->map['title']) && !empty($this->map['title'])){
$this->map['title'] = ['like','%'.$this->map['title'].'%'];
}
$this->map['project_id'] = $this->user['project_id'];
return $this->map;
}
/**
* @remark :查看产品是否已装修
* @name :getProductIsRenovation
* @author :lyh
... ...
... ... @@ -105,7 +105,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']]);
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'];
... ... @@ -142,7 +142,7 @@ class BTemplateLogic extends BaseLogic
}
//兼容老数据
$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']]);
if($commonInfo !== false){
$html = $commonInfo['head_css'].$main_style.$commonInfo['footer_css'].$commonInfo['other'].
$commonInfo['head_html'].$main_html.$commonInfo['footer_html'];
... ...
... ... @@ -106,7 +106,6 @@ class NewsCategoryLogic extends BaseLogic
}else{
return $id;
}
}
/**
... ...
... ... @@ -197,6 +197,22 @@ class CategoryLogic extends BaseLogic
}
/**
* @remark :随机获取当前id下最后一级的id
* @name :getLastId
* @author :lyh
* @method :post
* @time :2023/10/20 9:45
*/
public function getLastId($id){
$info = $this->model->read(['pid'=>$id],['id']);
if($info !== false){
return $this->getLastId($info['id']);
}else{
return $id;
}
}
/**
* @remark :编辑路由时生成路由记录
* @name :editCategoryRoute
* @author :lyh
... ...