|
@@ -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
|
}
|