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(){ //