|
|
@@ -50,8 +50,8 @@ class CategoryClass extends BaseClass
|
|
|
public static function addCategory($data)
|
|
|
{
|
|
|
$categoryName = $data['categoryName'];
|
|
|
- $sjId = $data['sjId'];
|
|
|
- $exists = self::getByCondition(['sjId' => $sjId, 'delStatus' => 0, 'categoryName' => $categoryName]);
|
|
|
+ $mainId = $data['mainId'] ?? 0;
|
|
|
+ $exists = self::getByCondition(['mainId' => $mainId, 'delStatus' => 0, 'categoryName' => $categoryName]);
|
|
|
if (!empty($exists)) {
|
|
|
util::fail('分类名称已经存在');
|
|
|
}
|