实现策略删除功能

dev
曾超新 5 years ago
parent 3568b60012
commit f9f4e90003
  1. 25
      frontend/controllers/MarketingStrategyController.php
  2. 2
      frontend/views/marketing-strategy/index.php

@ -110,6 +110,31 @@ class MarketingStrategyController extends UserBaseController
return $result; 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() { public function actionUsers() {
$request = Yii::$app->request; $request = Yii::$app->request;
$id = $request->get('id'); $id = $request->get('id');

@ -71,7 +71,9 @@ use \common\libs\MyLib;
}, function(){ }, function(){
$.post('/marketing-strategy/delete',{id:id},function(data) { $.post('/marketing-strategy/delete',{id:id},function(data) {
parent.layer.msg(data.msg); parent.layer.msg(data.msg);
if(data.success) {
refreshList(); refreshList();
}
}, 'json'); }, 'json');
}, function(){ }, function(){
// //

Loading…
Cancel
Save