public function a(Request $request){
//獲取指定的id
$id = $request->id;
$rs=R::find($id);
//倉庫中
$re=$rs->rfid;
//判斷倉庫中的是否與數(shù)據(jù)庫的rf在線的是否相等
$ws= G::where('rfid','=',$re)->first();
if($ws){
return response()->json(['status'=>0,'msg'=>'不成功']);
}
//導(dǎo)入數(shù)據(jù)
$sql=DB::insert("insert into gs( g ,id,created_at,updated_at) values (?,?,?,?)",
[$rs->p,$rs->r,$rs->creat,$rs->up]);
// 成功刪除
if($sql){
$rs->delete();
return ['status'=>1,'msg'=>'成功'];
}else{
return response()->json(['status'=>0,'msg'=>'不成功']);
}
script>
$(".change").click(function () {
var id = $(this).data("id");
if(confirm("確定xxx")){
$.ajax({
url: '/',
type: 'get',
data: {'id':id},
success: function (res) {
if (res.status == 0) {
layer.msg(res.msg);
} else {
layer.msg(res.msg, {icon: 1}, function () {
location.href = '要跳轉(zhuǎn)的頁面';
});
}
}
});
}
});