|
|
@@ -12,18 +12,20 @@ class CategoryService extends BaseService
|
|
|
|
|
|
public static $baseFile = '\biz\goods\classes\CategoryClass';
|
|
|
|
|
|
- //取出要在首页显示的所有分类
|
|
|
- public static function getIndexShow()
|
|
|
+ //取出可用的分类 shish 2019.12.2
|
|
|
+ public static function getEnableList()
|
|
|
{
|
|
|
$merchantId = Yii::$app->params['merchantId'];
|
|
|
- $all = CategoryClass::getAllByCondition(['merchantId' => $merchantId, 'indexShow' => 1]);
|
|
|
- }
|
|
|
-
|
|
|
- //取菜单分类 shish 2019.12.2
|
|
|
- public static function getMenu()
|
|
|
- {
|
|
|
- $merchantId = Yii::$app->params['merchantId'];
|
|
|
- return CategoryClass::getAllByCondition(['merchantId' => $merchantId, 'menuShow' => 1]);
|
|
|
+ $cat = CategoryClass::getAllByCondition(['merchantId' => $merchantId], 'inTurn DESC', '*');
|
|
|
+ if (empty($cat)) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ //处理图片
|
|
|
+ $prefix = Yii::$app->params['imgUrl'];
|
|
|
+ foreach ($cat as $key => $info) {
|
|
|
+ $cat[$key]['cover'] = $prefix . $info['cover'];
|
|
|
+ }
|
|
|
+ return $cat;
|
|
|
}
|
|
|
|
|
|
}
|