作者 lyh

gx

@@ -40,7 +40,7 @@ class CategoryController extends BaseController @@ -40,7 +40,7 @@ class CategoryController extends BaseController
40 $data = []; 40 $data = [];
41 if(!empty($list)){ 41 if(!empty($list)){
42 foreach ($list as $k =>$v){ 42 foreach ($list as $k =>$v){
43 - $v = $this->handleParam($category,$v); 43 + $v = $this->handleParam($v);
44 $list[$k] = $v; 44 $list[$k] = $v;
45 } 45 }
46 $data = $this->getListSon($list); 46 $data = $this->getListSon($list);
@@ -55,9 +55,9 @@ class CategoryController extends BaseController @@ -55,9 +55,9 @@ class CategoryController extends BaseController
55 * @method :post 55 * @method :post
56 * @time :2023/8/17 11:10 56 * @time :2023/8/17 11:10
57 */ 57 */
58 - public function handleParam(&$category,$v){ 58 + public function handleParam($v){
59 $v['url'] = $this->user['domain'] . RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_CATE, $v['id'], $v['project_id']); 59 $v['url'] = $this->user['domain'] . RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_CATE, $v['id'], $v['project_id']);
60 - $v['product_num'] = Product::where('category_id','like' ,'%,'.$v['category_id'].',%')->count();; 60 + $v['product_num'] = Product::where('category_id','like' ,'%,'.$v['id'].',%')->count();;
61 $v['image_link'] = getImageUrl($v['image']); 61 $v['image_link'] = getImageUrl($v['image']);
62 return $v; 62 return $v;
63 } 63 }
@@ -40,7 +40,7 @@ class KeywordController extends BaseController @@ -40,7 +40,7 @@ class KeywordController extends BaseController
40 $data = $keyword->lists($this->map,$this->page,$this->row,$this->order,$filed); 40 $data = $keyword->lists($this->map,$this->page,$this->row,$this->order,$filed);
41 if(!empty($data)){ 41 if(!empty($data)){
42 foreach ($data['list'] as &$v){ 42 foreach ($data['list'] as &$v){
43 - $v['product_num'] = Product::where('keyword_id','like' ,'%,'.$v['keyword_id'].',%')->count(); 43 + $v['product_num'] = Product::where('keyword_id','like' ,'%,'.$v['id'].',%')->count();
44 $v['tdk'] = boolval($v['seo_title']) * boolval($v['seo_keywords']) * boolval($v['seo_description']); 44 $v['tdk'] = boolval($v['seo_title']) * boolval($v['seo_keywords']) * boolval($v['seo_description']);
45 $v['url'] = $this->user['domain'] . RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); 45 $v['url'] = $this->user['domain'] . RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']);
46 } 46 }