正在显示
5 个修改的文件
包含
23 行增加
和
20 行删除
| @@ -26,7 +26,7 @@ class NewsController extends BaseController | @@ -26,7 +26,7 @@ class NewsController extends BaseController | ||
| 26 | * @method | 26 | * @method |
| 27 | */ | 27 | */ |
| 28 | public function lists(NewsModel $news){ | 28 | public function lists(NewsModel $news){ |
| 29 | - $filed = ['id','category_id','operator_id','status','created_at','label_id','image','updated_at','name','sort','url']; | 29 | + $filed = ['id','category_id','operator_id','status','created_at','image','updated_at','name','sort','url']; |
| 30 | $this->order = 'sort'; | 30 | $this->order = 'sort'; |
| 31 | $query = $news->orderBy($this->order ,'desc'); | 31 | $query = $news->orderBy($this->order ,'desc'); |
| 32 | $query = $this->searchParam($query); | 32 | $query = $this->searchParam($query); |
| @@ -73,7 +73,7 @@ class ProductController extends BaseController | @@ -73,7 +73,7 @@ class ProductController extends BaseController | ||
| 73 | * @method :post | 73 | * @method :post |
| 74 | * @time :2023/9/14 10:01 | 74 | * @time :2023/9/14 10:01 |
| 75 | */ | 75 | */ |
| 76 | - public function searchParams(&$query){ | 76 | + public function searchParam(&$query){ |
| 77 | $query = $query->where('project_id',$this->user['project_id']); | 77 | $query = $query->where('project_id',$this->user['project_id']); |
| 78 | if (isset($this->map['category_id']) && !empty($this->map['category_id'])) { | 78 | if (isset($this->map['category_id']) && !empty($this->map['category_id'])) { |
| 79 | $str = []; | 79 | $str = []; |
| @@ -84,6 +84,9 @@ class ProductController extends BaseController | @@ -84,6 +84,9 @@ class ProductController extends BaseController | ||
| 84 | } | 84 | } |
| 85 | }); | 85 | }); |
| 86 | } | 86 | } |
| 87 | + if(isset($this->map['title']) && !empty($this->map['title'])){ | ||
| 88 | + $query = $query->where('title','like','%'.$this->map['title'].'%'); | ||
| 89 | + } | ||
| 87 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ | 90 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ |
| 88 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); | 91 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); |
| 89 | } | 92 | } |
| @@ -91,21 +94,6 @@ class ProductController extends BaseController | @@ -91,21 +94,6 @@ class ProductController extends BaseController | ||
| 91 | } | 94 | } |
| 92 | 95 | ||
| 93 | /** | 96 | /** |
| 94 | - * @remark :搜索参数处理 | ||
| 95 | - * @name :searchParam | ||
| 96 | - * @author :lyh | ||
| 97 | - * @method :post | ||
| 98 | - * @time :2023/9/14 14:32 | ||
| 99 | - */ | ||
| 100 | - public function searchParam(){ | ||
| 101 | - if(isset($this->map['title']) && !empty($this->map['title'])){ | ||
| 102 | - $this->map['title'] = ['like','%'.$this->map['title'].'%']; | ||
| 103 | - } | ||
| 104 | - $this->map['project_id'] = $this->user['project_id']; | ||
| 105 | - return $this->map; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - /** | ||
| 109 | * @remark :查看产品是否已装修 | 97 | * @remark :查看产品是否已装修 |
| 110 | * @name :getProductIsRenovation | 98 | * @name :getProductIsRenovation |
| 111 | * @author :lyh | 99 | * @author :lyh |
| @@ -105,7 +105,7 @@ class BTemplateLogic extends BaseLogic | @@ -105,7 +105,7 @@ class BTemplateLogic extends BaseLogic | ||
| 105 | $TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]); | 105 | $TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]); |
| 106 | }else{ | 106 | }else{ |
| 107 | $commonTemplateModel = new BTemplateCommon(); | 107 | $commonTemplateModel = new BTemplateCommon(); |
| 108 | - $commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>$source]); | 108 | + $commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id']]); |
| 109 | if($commonInfo !== false){ | 109 | if($commonInfo !== false){ |
| 110 | $TemplateInfo['html'] = $commonInfo['head_css'].$TemplateInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. | 110 | $TemplateInfo['html'] = $commonInfo['head_css'].$TemplateInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. |
| 111 | $commonInfo['head_html'].$TemplateInfo['main_html'].$commonInfo['footer_html']; | 111 | $commonInfo['head_html'].$TemplateInfo['main_html'].$commonInfo['footer_html']; |
| @@ -142,7 +142,7 @@ class BTemplateLogic extends BaseLogic | @@ -142,7 +142,7 @@ class BTemplateLogic extends BaseLogic | ||
| 142 | } | 142 | } |
| 143 | //兼容老数据 | 143 | //兼容老数据 |
| 144 | $commonTemplateModel = new BTemplateCommon(); | 144 | $commonTemplateModel = new BTemplateCommon(); |
| 145 | - $commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>$source]); | 145 | + $commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id']]); |
| 146 | if($commonInfo !== false){ | 146 | if($commonInfo !== false){ |
| 147 | $html = $commonInfo['head_css'].$main_style.$commonInfo['footer_css'].$commonInfo['other']. | 147 | $html = $commonInfo['head_css'].$main_style.$commonInfo['footer_css'].$commonInfo['other']. |
| 148 | $commonInfo['head_html'].$main_html.$commonInfo['footer_html']; | 148 | $commonInfo['head_html'].$main_html.$commonInfo['footer_html']; |
| @@ -197,6 +197,22 @@ class CategoryLogic extends BaseLogic | @@ -197,6 +197,22 @@ class CategoryLogic extends BaseLogic | ||
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | /** | 199 | /** |
| 200 | + * @remark :随机获取当前id下最后一级的id | ||
| 201 | + * @name :getLastId | ||
| 202 | + * @author :lyh | ||
| 203 | + * @method :post | ||
| 204 | + * @time :2023/10/20 9:45 | ||
| 205 | + */ | ||
| 206 | + public function getLastId($id){ | ||
| 207 | + $info = $this->model->read(['pid'=>$id],['id']); | ||
| 208 | + if($info !== false){ | ||
| 209 | + return $this->getLastId($info['id']); | ||
| 210 | + }else{ | ||
| 211 | + return $id; | ||
| 212 | + } | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | + /** | ||
| 200 | * @remark :编辑路由时生成路由记录 | 216 | * @remark :编辑路由时生成路由记录 |
| 201 | * @name :editCategoryRoute | 217 | * @name :editCategoryRoute |
| 202 | * @author :lyh | 218 | * @author :lyh |
-
请 注册 或 登录 后发表评论