正在显示
1 个修改的文件
包含
18 行增加
和
1 行删除
| @@ -32,7 +32,19 @@ class CategoryController extends BaseController | @@ -32,7 +32,19 @@ class CategoryController extends BaseController | ||
| 32 | $this->map = $this->searchParam(); | 32 | $this->map = $this->searchParam(); |
| 33 | $filed = ['id', 'project_id', 'pid', 'title', 'image', 'route', 'status','created_at','sort']; | 33 | $filed = ['id', 'project_id', 'pid', 'title', 'image', 'route', 'status','created_at','sort']; |
| 34 | $this->map['deleted_at'] = null; | 34 | $this->map['deleted_at'] = null; |
| 35 | - $this->map['pid'] = $this->map['pid'] ?? 0; | 35 | + if($this->user['project_id'] == 3283){//分类太多加载失败 |
| 36 | + $this->map['pid'] = ($this->map['pid'] ?? 0); | ||
| 37 | + $list = $category->list($this->map,['sort','id'],$filed); | ||
| 38 | + $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST);//获取模版id | ||
| 39 | + foreach ($list as $k =>$v){ | ||
| 40 | + $v['url'] = $this->user['domain'] . $v['route'].'/'; | ||
| 41 | + $v['product_num'] = $category->getProductNum($list,$v['id']); | ||
| 42 | + $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); | ||
| 43 | + $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST,$template_id,$v['id']); | ||
| 44 | + $list[$k] = $v; | ||
| 45 | + } | ||
| 46 | + return $this->response('success',Code::SUCCESS,$list); | ||
| 47 | + }else{ | ||
| 36 | $list = $category->list($this->map,['sort','id'],$filed); | 48 | $list = $category->list($this->map,['sort','id'],$filed); |
| 37 | $data = []; | 49 | $data = []; |
| 38 | if(!empty($list)){ | 50 | if(!empty($list)){ |
| @@ -44,10 +56,15 @@ class CategoryController extends BaseController | @@ -44,10 +56,15 @@ class CategoryController extends BaseController | ||
| 44 | $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST,$template_id,$v['id']); | 56 | $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST,$template_id,$v['id']); |
| 45 | $list[$k] = $v; | 57 | $list[$k] = $v; |
| 46 | } | 58 | } |
| 59 | + if(!isset($this->map['title'])){ | ||
| 60 | + $data = $this->getListSon($list); | ||
| 61 | + }else{ | ||
| 47 | $data = $list; | 62 | $data = $list; |
| 48 | } | 63 | } |
| 64 | + } | ||
| 49 | return $this->response('success',Code::SUCCESS,$data); | 65 | return $this->response('success',Code::SUCCESS,$data); |
| 50 | } | 66 | } |
| 67 | + } | ||
| 51 | 68 | ||
| 52 | /** | 69 | /** |
| 53 | * @remark :搜索参数处理 | 70 | * @remark :搜索参数处理 |
-
请 注册 或 登录 后发表评论