|
@@ -55,7 +55,7 @@ class ProductController extends BaseController |
|
@@ -55,7 +55,7 @@ class ProductController extends BaseController |
|
55
|
if(!empty($lists)){
|
55
|
if(!empty($lists)){
|
|
56
|
$lists = $lists->toArray();
|
56
|
$lists = $lists->toArray();
|
|
57
|
$cate_data = $this->getCategoryList();//分类
|
57
|
$cate_data = $this->getCategoryList();//分类
|
|
58
|
- $key_data = $this->getKeywordsList();//关键字
|
58
|
+ $key_data = $this->keywordNameLists($lists['list']);//关键字
|
|
59
|
$template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);//获取模版id
|
59
|
$template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);//获取模版id
|
|
60
|
$userModel = new User();
|
60
|
$userModel = new User();
|
|
61
|
foreach ($lists['list'] as $k=>$v){
|
61
|
foreach ($lists['list'] as $k=>$v){
|
|
@@ -72,6 +72,30 @@ class ProductController extends BaseController |
|
@@ -72,6 +72,30 @@ class ProductController extends BaseController |
|
72
|
}
|
72
|
}
|
|
73
|
|
73
|
|
|
74
|
/**
|
74
|
/**
|
|
|
|
75
|
+ * @remark :获取当前页的所有关键字名称
|
|
|
|
76
|
+ * @name :keywordNameLists
|
|
|
|
77
|
+ * @author :lyh
|
|
|
|
78
|
+ * @method :post
|
|
|
|
79
|
+ * @time :2024/6/3 14:24
|
|
|
|
80
|
+ */
|
|
|
|
81
|
+ public function keywordNameLists($lists){
|
|
|
|
82
|
+ $keywordId = [];
|
|
|
|
83
|
+ foreach ($lists as $v){
|
|
|
|
84
|
+ $keywordId = array_merge($keywordId,$v['keyword_id']);
|
|
|
|
85
|
+ }
|
|
|
|
86
|
+ $keywordId = array_values(array_unique($keywordId));
|
|
|
|
87
|
+ $keywordModel = new Keyword();
|
|
|
|
88
|
+ $data = [];
|
|
|
|
89
|
+ $cateList = $keywordModel->list(['id' => ['in',$keywordId]], ['id', 'title']);
|
|
|
|
90
|
+ if (!empty($cateList)) {
|
|
|
|
91
|
+ foreach ($cateList as $value) {
|
|
|
|
92
|
+ $data[$value['id']] = $value['title'];
|
|
|
|
93
|
+ }
|
|
|
|
94
|
+ }
|
|
|
|
95
|
+ return $data;
|
|
|
|
96
|
+ }
|
|
|
|
97
|
+
|
|
|
|
98
|
+ /**
|
|
75
|
* @remark :不分页产品列表
|
99
|
* @remark :不分页产品列表
|
|
76
|
* @name :productNoPage
|
100
|
* @name :productNoPage
|
|
77
|
* @author :lyh
|
101
|
* @author :lyh
|