|
|
@@ -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('删除成功');
|
|
|
+ }
|
|
|
+
|
|
|
}
|