作者 lyh

gx

@@ -60,7 +60,7 @@ class ProductController extends BaseController @@ -60,7 +60,7 @@ class ProductController extends BaseController
60 $userModel = new User(); 60 $userModel = new User();
61 foreach ($lists['list'] as $k=>$v){ 61 foreach ($lists['list'] as $k=>$v){
62 $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']);; 62 $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']);;
63 - $v['category_id_text'] = $this->categoryName($v['category_id'],$cate_data); 63 + $v['category_id_text'] = $this->categoryName($v['id'],$cate_data);
64 $v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data); 64 $v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data);
65 $v['created_uid_text'] = $userModel->getName($v['created_uid']); 65 $v['created_uid_text'] = $userModel->getName($v['created_uid']);
66 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']); 66 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']);
@@ -244,7 +244,9 @@ class ProductController extends BaseController @@ -244,7 +244,9 @@ class ProductController extends BaseController
244 * @method :post 244 * @method :post
245 * @time :2023/9/14 13:58 245 * @time :2023/9/14 13:58
246 */ 246 */
247 - public function categoryName($category_id,$data){ 247 + public function categoryName($product_id,$data){
  248 + $cateRelatedModel = new CategoryRelated();
  249 + $category_id = $cateRelatedModel->where('product_id',$product_id)->plack('cate_id')->toArray();
248 $category_name = ''; 250 $category_name = '';
249 if(!empty($category_id) && !empty($data)){ 251 if(!empty($category_id) && !empty($data)){
250 foreach ($category_id as $v){ 252 foreach ($category_id as $v){