2, 'pay_order_id' => $orderid, ]; $u = DB::table('transfer_code')->where(['code' => $code, 'status' => 1, 'is_del' => 0])->update($data); $data2=[ 'qudao_type' => $qudao_type, 'code' => $code, ]; DB::table('orders')->where(['id'=>$orderid])->update(['sanfang_code'=>json_encode($data2,JSON_UNESCAPED_UNICODE)]); if ($u) { return ['status'=>true,'msg'=>'操作成功']; } else { return ['status'=>false,'msg'=>'核销失败']; } } } //撤销核销 public function CancelSanFangCode($qudao_type, $code,$orderid){ if ($qudao_type == 1) { $u = false; $data = [ 'status' => 1, 'pay_order_id' => null, ]; $u = DB::table('transfer_code')->where(['code' => $code, 'status' => 2, 'is_del' => 0])->update($data); if ($u) { return ['status'=>true,'msg'=>'操作成功']; } else { return ['status'=>false,'msg'=>'撤销失败']; } } } }