|
|
@@ -17,11 +17,11 @@ class CategoryService extends BaseService
|
|
|
public static $baseFile = '\bizHd\goods\classes\CategoryClass';
|
|
|
|
|
|
//取所有的分类 ssh 2019.12.7
|
|
|
- public static function getCategoryList($sjId, $property = '')
|
|
|
+ public static function getCategoryList($mainId, $flower = '')
|
|
|
{
|
|
|
- $where = ['sjId' => $sjId, 'delStatus' => 0];
|
|
|
- if (is_numeric($property)) {
|
|
|
- $where['property'] = $property;
|
|
|
+ $where = ['mainId' => $mainId, 'delStatus' => 0];
|
|
|
+ if (is_numeric($flower)) {
|
|
|
+ $where['flower'] = $flower;
|
|
|
}
|
|
|
$cat = CategoryClass::getAllByCondition($where, 'inTurn DESC', '*');
|
|
|
if (empty($cat)) {
|
|
|
@@ -37,9 +37,9 @@ class CategoryService extends BaseService
|
|
|
}
|
|
|
|
|
|
//取出可用的分类 ssh 2019.12.2
|
|
|
- public static function getEnableList($sjId)
|
|
|
+ public static function getEnableList($mainId)
|
|
|
{
|
|
|
- $cat = CategoryClass::getAllByCondition(['sjId' => $sjId, 'delStatus' => 0, 'status' => 1], 'inTurn DESC', '*');
|
|
|
+ $cat = CategoryClass::getAllByCondition(['mainId' => $mainId, 'delStatus' => 0, 'status' => 1], 'inTurn DESC', '*');
|
|
|
if (empty($cat)) {
|
|
|
return [];
|
|
|
}
|
|
|
@@ -52,24 +52,24 @@ class CategoryService extends BaseService
|
|
|
}
|
|
|
|
|
|
//获取商家所有的分类名称
|
|
|
- public static function getNameList($sjId)
|
|
|
+ public static function getNameList($mainId)
|
|
|
{
|
|
|
- $cat = CategoryClass::getAllByCondition(['sjId' => $sjId, 'delStatus' => 0], 'inTurn DESC', '*');
|
|
|
+ $cat = CategoryClass::getAllByCondition(['mainId' => $mainId, 'delStatus' => 0], 'inTurn DESC', '*');
|
|
|
return empty($cat) ? [] : array_column($cat, 'categoryName');
|
|
|
}
|
|
|
|
|
|
//获取商家最靠前的分类id ssh 2019.12.2
|
|
|
- public static function getTopCategoryId($sjId)
|
|
|
+ public static function getTopCategoryId($mainId)
|
|
|
{
|
|
|
- $cat = CategoryClass::getByCondition(['sjId' => $sjId, 'delStatus' => 0, 'status' => 1], false, 'inTurn DESC');
|
|
|
+ $cat = CategoryClass::getByCondition(['mainId' => $mainId, 'delStatus' => 0, 'status' => 1], false, 'inTurn DESC');
|
|
|
$id = isset($cat['id']) ? $cat['id'] : 0;
|
|
|
return $id;
|
|
|
}
|
|
|
|
|
|
//获取前三个分类信息 ssh 2019.12.2
|
|
|
- public static function getTopThreeCategory($sjId)
|
|
|
+ public static function getTopThreeCategory($mainId)
|
|
|
{
|
|
|
- $cat = CategoryClass::getLimitList('id,categoryName', ['sjId' => $sjId, 'delStatus' => 0, 'status' => 1], 3, 'inTurn DESC');
|
|
|
+ $cat = CategoryClass::getLimitList('id,categoryName', ['mainId' => $mainId, 'delStatus' => 0, 'status' => 1], 3, 'inTurn DESC');
|
|
|
if (empty($cat)) {
|
|
|
return [];
|
|
|
}
|
|
|
@@ -77,9 +77,9 @@ class CategoryService extends BaseService
|
|
|
}
|
|
|
|
|
|
//验证操作权限 ssh 2019.12.8
|
|
|
- public static function valid($category, $sjId)
|
|
|
+ public static function valid($category, $mainId)
|
|
|
{
|
|
|
- if (isset($category['sjId']) == false || $category['sjId'] != $sjId) {
|
|
|
+ if (isset($category['mainId']) == false || $category['mainId'] != $mainId) {
|
|
|
util::fail('您没有权限操作');
|
|
|
}
|
|
|
}
|
|
|
@@ -124,11 +124,9 @@ class CategoryService extends BaseService
|
|
|
}
|
|
|
|
|
|
//获取开单页所有的分类:包括、常用
|
|
|
- public static function getCategoryClassAll($sjId)
|
|
|
+ public static function getCategoryClassAll($mainId)
|
|
|
{
|
|
|
- $where = [
|
|
|
- 'sjId' => $sjId
|
|
|
- ];
|
|
|
+ $where = ['mainId' => $mainId];
|
|
|
$data = self::getAllList('id,categoryName as name', $where, 'inTurn desc');
|
|
|
$use = [
|
|
|
'id' => -2,
|