作者 lyh

gx

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