正在显示
1 个修改的文件
包含
4 行增加
和
4 行删除
| @@ -44,15 +44,14 @@ class ProductController extends BaseController | @@ -44,15 +44,14 @@ class ProductController extends BaseController | ||
| 44 | $filed = ['id', 'project_id', 'title', 'sort' ,'thumb', 'gallery' ,'product_type' , 'route' , | 44 | $filed = ['id', 'project_id', 'title', 'sort' ,'thumb', 'gallery' ,'product_type' , 'route' , |
| 45 | 'category_id', 'keyword_id', 'status', 'created_uid', 'created_at', 'updated_at']; | 45 | 'category_id', 'keyword_id', 'status', 'created_uid', 'created_at', 'updated_at']; |
| 46 | $lists = $product->lists($this->map,$this->page,$this->row,$this->order = ['sort','id'],$filed); | 46 | $lists = $product->lists($this->map,$this->page,$this->row,$this->order = ['sort','id'],$filed); |
| 47 | - if(!empty($lists['list'])){ | 47 | + if(!empty($lists) && !empty($lists['list'])){ |
| 48 | + $cate_data = $this->getCategoryList();//分类 | ||
| 49 | + $key_data = $this->getKeywordsList();//关键字 | ||
| 48 | //获取当前用户选择的模版 | 50 | //获取当前用户选择的模版 |
| 49 | $templateSettingModel = new BSetting(); | 51 | $templateSettingModel = new BSetting(); |
| 50 | $info = $templateSettingModel->read(['project_id'=>$this->user['project_id']]); | 52 | $info = $templateSettingModel->read(['project_id'=>$this->user['project_id']]); |
| 51 | - $cate_data = $this->getCategoryList(); | ||
| 52 | - $key_data = $this->getKeywordsList(); | ||
| 53 | $userModel = new User(); | 53 | $userModel = new User(); |
| 54 | foreach ($lists['list'] as $k=>$v){ | 54 | foreach ($lists['list'] as $k=>$v){ |
| 55 | - //处理参数 | ||
| 56 | $v['category_id_text'] = $this->categoryName($v['category_id'],$cate_data); | 55 | $v['category_id_text'] = $this->categoryName($v['category_id'],$cate_data); |
| 57 | $v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data); | 56 | $v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data); |
| 58 | $v['created_uid_text'] = $userModel->getName($v['created_uid']); | 57 | $v['created_uid_text'] = $userModel->getName($v['created_uid']); |
| @@ -236,6 +235,7 @@ class ProductController extends BaseController | @@ -236,6 +235,7 @@ class ProductController extends BaseController | ||
| 236 | $v['keyword_id_text'] = trim($v['keyword_id_text'],','); | 235 | $v['keyword_id_text'] = trim($v['keyword_id_text'],','); |
| 237 | } | 236 | } |
| 238 | $v['status_text'] = Product::statusMap()[$v['status']] ?? ''; | 237 | $v['status_text'] = Product::statusMap()[$v['status']] ?? ''; |
| 238 | + $v['is_renovation'] = $this->getProductIsRenovation($v,$v['id']); | ||
| 239 | $v['url'] = $this->user['domain'].$v['route']; | 239 | $v['url'] = $this->user['domain'].$v['route']; |
| 240 | return $v; | 240 | return $v; |
| 241 | } | 241 | } |
-
请 注册 或 登录 后发表评论