Browse Source

修改花材

shish 8 months ago
parent
commit
bf9ad71e98
1 changed files with 21 additions and 0 deletions
  1. 21 0
      app-hd/controllers/ItemController.php

+ 21 - 0
app-hd/controllers/ItemController.php

@@ -407,4 +407,25 @@ class ItemController extends BaseController
         }
         util::fail('更新失败');
     }
+
+    public function actionChangeFrontHide()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $status = $get['status'] ?? '';
+        if (is_numeric($status) == false) {
+            util::fail('请选择方式');
+        }
+        $info = ItemClass::getById($id, true);
+        if (empty($info)) {
+            util::fail('没有找到花材');
+        }
+        if ($info->mainId != $this->mainId) {
+            util::fail('不是你的花材呢');
+        }
+        $info->frontHide = $status;
+        $info->save();
+        util::complete();
+    }
+
 }