shish 3 лет назад
Родитель
Сommit
0580c4bb1a
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      app-hd/controllers/AddressController.php

+ 16 - 0
app-hd/controllers/AddressController.php

@@ -9,6 +9,22 @@ use common\components\util;
 class AddressController extends BaseController
 {
 
+    //删除地址 ssh 202201003
+    public function actionDel()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $address = AddressClass::getById($id, true);
+        if (empty($address)) {
+            util::fail('没有找到地址');
+        }
+        if ($address->mainId != $this->mainId) {
+            util::fail('没有权限');
+        }
+        $address->delete();
+        util::complete();
+    }
+
     //地址列表 ssh 20221003
     public function actionList()
     {