shish il y a 2 ans
Parent
commit
8a6f27f7b9
1 fichiers modifiés avec 16 ajouts et 0 suppressions
  1. 16 0
      app-ghs/controllers/CpItemController.php

+ 16 - 0
app-ghs/controllers/CpItemController.php

@@ -24,4 +24,20 @@ class CpItemController extends BaseController
         util::success($respond);
     }
 
+    //删除关系 ssh 20240115
+    public function actionDel()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $item = CpItemClass::getById($id, true);
+        if (empty($item)) {
+            util::fail('没有找到');
+        }
+        if ($item->mainId != $this->mainId) {
+            util::fail('不是你的产品');
+        }
+        $item->delete();
+        util::complete('删除成功');
+    }
+
 }