作者 lyh

gx

... ... @@ -44,15 +44,14 @@ class ProductController extends BaseController
$filed = ['id', 'project_id', 'title', 'sort' ,'thumb', 'gallery' ,'product_type' , 'route' ,
'category_id', 'keyword_id', 'status', 'created_uid', 'created_at', 'updated_at'];
$lists = $product->lists($this->map,$this->page,$this->row,$this->order = ['sort','id'],$filed);
if(!empty($lists['list'])){
if(!empty($lists) && !empty($lists['list'])){
$cate_data = $this->getCategoryList();//分类
$key_data = $this->getKeywordsList();//关键字
//获取当前用户选择的模版
$templateSettingModel = new BSetting();
$info = $templateSettingModel->read(['project_id'=>$this->user['project_id']]);
$cate_data = $this->getCategoryList();
$key_data = $this->getKeywordsList();
$userModel = new User();
foreach ($lists['list'] as $k=>$v){
//处理参数
$v['category_id_text'] = $this->categoryName($v['category_id'],$cate_data);
$v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data);
$v['created_uid_text'] = $userModel->getName($v['created_uid']);
... ... @@ -236,6 +235,7 @@ class ProductController extends BaseController
$v['keyword_id_text'] = trim($v['keyword_id_text'],',');
}
$v['status_text'] = Product::statusMap()[$v['status']] ?? '';
$v['is_renovation'] = $this->getProductIsRenovation($v,$v['id']);
$v['url'] = $this->user['domain'].$v['route'];
return $v;
}
... ...