|
|
@@ -14,9 +14,24 @@ class CustomLevelController extends BaseController
|
|
|
{
|
|
|
$info = CustomLevelClass::getByCondition(['shopId' => $this->shopId]);
|
|
|
if (empty($info)) {
|
|
|
- $info = [];
|
|
|
+ $data = ['sjId' => $this->sjId, 'shopId' => $this->shopId];
|
|
|
+ CustomLevelClass::add($data, true);
|
|
|
+ $info = CustomLevelClass::getByCondition(['shopId' => $this->shopId]);
|
|
|
}
|
|
|
util::success(['info' => $info]);
|
|
|
}
|
|
|
|
|
|
+ //添加修改等级 shish 20211016
|
|
|
+ public function actionReplace()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $info = CustomLevelClass::getByCondition(['shopId' => $this->shopId], true);
|
|
|
+ if (empty($info)) {
|
|
|
+ util::fail('出错了');
|
|
|
+ }
|
|
|
+ $id = $info->id ?? 0;
|
|
|
+ CustomLevelClass::updateById($id, $post);
|
|
|
+ util::complete('修改成功');
|
|
|
+ }
|
|
|
+
|
|
|
}
|