作者 anyv
1 个管道 的构建 通过 耗费 2 秒

修改核销

... ... @@ -43,15 +43,21 @@ class HexiaoController extends AdminBaseController{
}*/
$shijian = time();
$update = Db::name('coupons_user') -> where('code',$code) -> update(['state' => 1,'time'=>$shijian]);
if($update){
return 1;
$code_zuixin = Db::name('coupons_user') -> where('code',$code) -> find();
if($code_zuixin['state'] != 1){
$update = Db::name('coupons_user') -> where('code',$code) -> update(['state' => 1,'time'=>$shijian]);
if($update){
return 1;
}else{
return 4;
}
}else{
return 4;
}
}else{
return 3;
}
... ...