From f9f4e90003433fdbe218c8d5dfdcc31279d5328a Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Mon, 4 Nov 2019 17:03:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=AD=96=E7=95=A5=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarketingStrategyController.php | 25 +++++++++++++++++++ frontend/views/marketing-strategy/index.php | 4 ++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/frontend/controllers/MarketingStrategyController.php b/frontend/controllers/MarketingStrategyController.php index fb21ba7..d345860 100644 --- a/frontend/controllers/MarketingStrategyController.php +++ b/frontend/controllers/MarketingStrategyController.php @@ -110,6 +110,31 @@ class MarketingStrategyController extends UserBaseController return $result; } + public function actionDelete() { + Yii::$app->response->format = Response::FORMAT_JSON; + $request = Yii::$app->request; + $result = array(); + $result['success'] = false; + $result['msg'] = '删除失败'; + + $id = $request->post('id',0); + + if($id == 0) + return $result; + + $tichengTypeT = ZhongjiYingxiao::findOne(['id'=>$id]); + if($tichengTypeT) { + $tichengTypeT->is_delete = 1; + $tichengTypeT->save(); + } + + + $result['success'] = true; + $result['msg'] = '删除成功'; + + return $result; + } + public function actionUsers() { $request = Yii::$app->request; $id = $request->get('id'); diff --git a/frontend/views/marketing-strategy/index.php b/frontend/views/marketing-strategy/index.php index 60db931..c3f44bb 100644 --- a/frontend/views/marketing-strategy/index.php +++ b/frontend/views/marketing-strategy/index.php @@ -71,7 +71,9 @@ use \common\libs\MyLib; }, function(){ $.post('/marketing-strategy/delete',{id:id},function(data) { parent.layer.msg(data.msg); - refreshList(); + if(data.success) { + refreshList(); + } }, 'json'); }, function(){ //