|
|
@@ -12,10 +12,18 @@ class CategoryService extends BaseService
|
|
|
{
|
|
|
public static $baseFile = '\bizHd\goods\classes\CategoryClass';
|
|
|
|
|
|
- //取所有的分类 ssh 2019.12.7
|
|
|
- public static function getCategoryList($mainId)
|
|
|
+ /**
|
|
|
+ * 取分类列表(管理端/配置选类用)
|
|
|
+ * @param int $mainId 商家 mainId
|
|
|
+ * @param bool $onlyEnabled true 时只返回启用且未删除分类(首页配置关联分类等)
|
|
|
+ */
|
|
|
+ public static function getCategoryList($mainId, $onlyEnabled = false)
|
|
|
{
|
|
|
$where = ['mainId' => $mainId, 'delStatus' => 0];
|
|
|
+ // 首页轮播/金刚区等选分类:排除禁用(status!=1)
|
|
|
+ if ($onlyEnabled) {
|
|
|
+ $where['status'] = 1;
|
|
|
+ }
|
|
|
$cat = CategoryClass::getAllByCondition($where, 'inTurn DESC', '*');
|
|
|
if (empty($cat)) {
|
|
|
return $cat;
|