正在显示
1 个修改的文件
包含
12 行增加
和
10 行删除
| @@ -781,8 +781,9 @@ class BTemplateLogic extends BaseLogic | @@ -781,8 +781,9 @@ class BTemplateLogic extends BaseLogic | ||
| 781 | $productTypeModel = new ProductType(); | 781 | $productTypeModel = new ProductType(); |
| 782 | $productTypeList = $productTypeModel->list(['project_id'=>$this->user['project_id']],'id',['id','name']); | 782 | $productTypeList = $productTypeModel->list(['project_id'=>$this->user['project_id']],'id',['id','name']); |
| 783 | if(!empty($productTypeList)){ | 783 | if(!empty($productTypeList)){ |
| 784 | - foreach ($productTypeList as $items){ | ||
| 785 | - $items['id'] = 'product_type_'.$items['id']; | 784 | + foreach ($productTypeList as $item){ |
| 785 | + $items['id'] = 'product_type_'.$item['id']; | ||
| 786 | + $items['title'] = $item['name']; | ||
| 786 | $data["products"]["category"][] =$items; | 787 | $data["products"]["category"][] =$items; |
| 787 | } | 788 | } |
| 788 | } | 789 | } |
| @@ -840,20 +841,21 @@ class BTemplateLogic extends BaseLogic | @@ -840,20 +841,21 @@ class BTemplateLogic extends BaseLogic | ||
| 840 | foreach ($data as $key => $values){ | 841 | foreach ($data as $key => $values){ |
| 841 | switch ($values['name']){ | 842 | switch ($values['name']){ |
| 842 | case '产品': | 843 | case '产品': |
| 843 | - $productCategory = $this->getCategoryList((new Category()),1,['id','title','pid']); | ||
| 844 | - if(!empty($productCategory)){ | ||
| 845 | - foreach ($productCategory as $item){ | ||
| 846 | - $values['category'][] = $item; | ||
| 847 | - } | ||
| 848 | - } | ||
| 849 | $productTypeModel = new ProductType(); | 844 | $productTypeModel = new ProductType(); |
| 850 | $productTypeList = $productTypeModel->list(['project_id'=>$this->user['project_id']],'id',['id','name']); | 845 | $productTypeList = $productTypeModel->list(['project_id'=>$this->user['project_id']],'id',['id','name']); |
| 851 | if(!empty($productTypeList)){ | 846 | if(!empty($productTypeList)){ |
| 852 | - foreach ($productTypeList as $items){ | ||
| 853 | - $items['id'] = 'product_type_'.$items['id']; | 847 | + foreach ($productTypeList as $item){ |
| 848 | + $items['id'] = 'product_type_'.$item['id']; | ||
| 849 | + $items['title'] = $item['name']; | ||
| 854 | $values['category'][] = $items; | 850 | $values['category'][] = $items; |
| 855 | } | 851 | } |
| 856 | } | 852 | } |
| 853 | + $productCategory = $this->getCategoryList((new Category()),1,['id','title','pid']); | ||
| 854 | + if(!empty($productCategory)){ | ||
| 855 | + foreach ($productCategory as $item){ | ||
| 856 | + $values['category'][] = $item; | ||
| 857 | + } | ||
| 858 | + } | ||
| 857 | break; | 859 | break; |
| 858 | case '新闻': | 860 | case '新闻': |
| 859 | $newCategory = $this->getCategoryList((new NewsCategory()),0,['id','name','pid']); | 861 | $newCategory = $this->getCategoryList((new NewsCategory()),0,['id','name','pid']); |
-
请 注册 或 登录 后发表评论