标签:HERE article new else request info date remove alert
//文章管理(删除)
$(document).on(‘click‘,‘.del‘,function () {
// alert(123)
var id = $(this).parents("tr").attr(‘id‘);
//console.log(id)
var obj = $(this);
$.get(
"articledel",
{
id:id
},
function (data) {
console.log(data)
if(data.sum=="0"){
obj.parents(‘tr‘).remove();
}
}
);
});
//文章管理(删除)
public function articledel(Request $request){
$id = $request->get(‘id‘);
// dd($id);
$res = new Article();
$data = $res->articledel($id);
if($data){
return response()->json([‘sum‘=>0,‘msg‘=>‘删除成功‘]);
}else{
return response()->json([‘sum‘=>1,‘msg‘=>‘删除失败‘]);
}
}
//文章管理(删除)
public function articledel($id){
$yy = [
‘bid‘=>1
];
return $this->where(‘id‘,$id)->update($yy);
}
标签:HERE article new else request info date remove alert
原文地址:https://www.cnblogs.com/zhaolulu/p/11163705.html