Jelajahi Sumber

修改时间

shish 2 bulan lalu
induk
melakukan
05e3a4673c
2 mengubah file dengan 22 tambahan dan 0 penghapusan
  1. 2 0
      .aiignore
  2. 20 0
      app-hd/controllers/ShopController.php

+ 2 - 0
.aiignore

@@ -20,6 +20,8 @@ logs/
 .hbuilderx/
 .DS_Store
 
+.editorconfig
+
 # Secrets
 
 # Source maps

+ 20 - 0
app-hd/controllers/ShopController.php

@@ -180,6 +180,26 @@ class ShopController extends BaseController
         }
     }
 
+    //修改门店营业时间
+    public function actionUpdateOpenTime()
+    {
+        $post = Yii::$app->request->post();
+        $shopId = intval($post['shopId'] ?? $post['id'] ?? 0);
+        if ($shopId <= 0) {
+            $shopId = intval($this->shopId);
+        }
+        if ($shopId != intval($this->shopId)) {
+            util::fail('不是您的门店');
+        }
+        $shop = ShopClass::getShopInfo($shopId);
+        if (empty($shop)) {
+            util::fail('门店不存在');
+        }
+        ShopClass::valid($shop, $this->sjId);
+        ShopClass::updateOpenTime($shop, $post);
+        util::complete('修改成功');
+    }
+
     public function actionAdd()
     {
         $data = Yii::$app->request->post();