|
...
|
...
|
@@ -77,12 +77,12 @@ class CategoryController extends BaseController |
|
|
|
* @time :2025/3/19 14:38
|
|
|
|
*/
|
|
|
|
public function get3283Lists(&$category,$filed){
|
|
|
|
$this->map['pid'] = ($this->map['pid'] ?? 0);
|
|
|
|
$list = $category->list($this->map,['sort','id'],$filed);
|
|
|
|
$template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST);//获取模版id
|
|
|
|
foreach ($list as $k =>$v){
|
|
|
|
$v['url'] = $this->user['domain'] . $v['route'].'/';
|
|
|
|
$v['product_num'] = $category->getProductNum($list,$v['id']);
|
|
|
|
$v['hasChildren'] = $this->getCategoryHasChildren($category,$v['id']);
|
|
|
|
$v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
|
|
|
|
$v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST,$template_id,$v['id']);
|
|
|
|
$list[$k] = $v;
|
|
...
|
...
|
@@ -91,6 +91,21 @@ class CategoryController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :查看是否拥有子集
|
|
|
|
* @name :getCategoryHasChildren
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/20 9:18
|
|
|
|
*/
|
|
|
|
public function getCategoryHasChildren(&$category,$id){
|
|
|
|
$count = $category->counts(['pid'=>$id]);
|
|
|
|
if($count != 0){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :搜索参数处理
|
|
|
|
* @name :searchParam
|
|
|
|
* @author :lyh
|
...
|
...
|
|