Browse Source

管理端,文章隐藏成功提示

theo 3 years ago
parent
commit
f3db1276af
1 changed files with 3 additions and 1 deletions
  1. 3 1
      backendApi/modules/v1/controllers/BaseController.php

+ 3 - 1
backendApi/modules/v1/controllers/BaseController.php

@@ -153,12 +153,14 @@ class BaseController extends \yii\rest\ActiveController {
             if ($beforeFun) $beforeFun($selected);
             if ($statusTo == 'hide') {
                 $modelClass::updateAll(['STATUS' => 0], $condition, $params);
+                $stateStr = 'hide';
             } else {
                 $modelClass::updateAll(['STATUS' => 1], $condition, $params);
+                $stateStr = 'Unhide';
             }
             if ($afterFun) $afterFun($selected);
             $transaction->commit();
-            return self::notice($statusTo.' successfully');//删除成功
+            return self::notice($stateStr.' successfully'); // 隐藏/取消隐藏 成功
         } catch (Exception $e) {
             $transaction->rollBack();
             return self::notice($e->getMessage(), 500);