Răsfoiți Sursa

花材状态控制

shish 5 ani în urmă
părinte
comite
025883f275
1 a modificat fișierele cu 24 adăugiri și 0 ștergeri
  1. 24 0
      app-ghs/controllers/ProductController.php

+ 24 - 0
app-ghs/controllers/ProductController.php

@@ -435,6 +435,30 @@ class ProductController extends BaseController
         util::complete();
     }
 
+    //花材展示状态控制 shish 20210804
+    public function actionDelStatusUpdate()
+    {
+        $post = Yii::$app->request->post();
+
+        $shopAdmin = $this->shopAdmin;
+        $roleId = $shopAdmin['roleId'] ?? 0;
+        $role = AdminRoleClass::getById($roleId);
+        $roleName = $role['roleName'] ?? '';
+        if ($roleName == '员工') {
+            util::fail('没有权限操作');
+        }
+
+        $id = $post['id'] ?? 0;
+        $delStatus = $post['delStatus'] ?? 0;
+        $product = ProductClass::getById($id, true);
+        if ($product->shopId != $this->shopId) {
+            util::fail('没有权限操作');
+        }
+        $product->delStatus = $delStatus;
+        $product->save();
+        util::complete();
+    }
+
     //详情 ruidian 2021.5.3
     public function actionDetail()
     {