Quellcode durchsuchen

不能禁用自己

shish vor 5 Jahren
Ursprung
Commit
9830e6ebd6
2 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. 3 0
      app-hd/controllers/ShopAdminController.php
  2. 1 0
      sql.sql

+ 3 - 0
app-hd/controllers/ShopAdminController.php

@@ -67,6 +67,9 @@ class ShopAdminController extends BaseController
     {
         $get = Yii::$app->request->get();
         $id = isset($get['id']) && is_numeric($get['id']) ? $get['id'] : 0;
+        if ($id == $this->shopAdminId) {
+            util::fail('不能禁用自己');
+        }
         $status = isset($get['status']) ? $get['status'] : 0;
         $shopAdmin = ShopAdminService::getById($id);
         ShopAdminService::valid($shopAdmin, $this->shopId);

+ 1 - 0
sql.sql

@@ -2350,6 +2350,7 @@ ALTER TABLE xhPurchaseClear ADD shopId INT NOT NULL DEFAULT 0 COMMENT '门店id'
 ALTER TABLE xhPurchaseClear CHANGE `merchantId` `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id';
 ALTER TABLE xhPurchaseClear ADD ghsId INT NOT NULL DEFAULT 0 COMMENT '供货商id' AFTER `orderSn`;
 ALTER TABLE xhGhsCustom ADD debtNum INT NOT NULL DEFAULT 0 COMMENT '欠款笔数' AFTER `debtAmount`;
+ALTER TABLE xhShopAdmin ADD lastLogin TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后登陆时间' AFTER `status`;
 
 -------- ruidian 20210505
 ALTER TABLE `xhGoods`