no message

This commit is contained in:
[ddwe] 2023-03-18 16:40:01 +08:00
parent e1c98d96bf
commit 09972c7fdd
2 changed files with 9 additions and 6 deletions

View File

@ -78,11 +78,11 @@ class ApiOrderServices
//订单无效
if ($has_order->status == 4) {
return abort(403, '订单已取消');
return $this->msg(['error' => 403, 'msg' => '订单已取消']);
}
if ($has_order->status == 3) {
return abort(403, '订单已取消');
return $this->msg(['error' => 403, 'msg' => '订单已取消']);
}
//如果支付2进行跳转
if (in_array($has_order->pay_status, [1, 2])) {
@ -91,7 +91,7 @@ class ApiOrderServices
}
//判断订单是否无效15分钟有效
if (strtotime($has_order->created_at) <= (time() - 60 * $this->timeOut)) {
return abort(403, '订单已过期');
return $this->msg(['error' => 403, 'msg' => '订单已过期']);
}
//如果没有支付,则
if ($has_order->pay_status == 0) {
@ -112,15 +112,15 @@ class ApiOrderServices
//如果是citpay需要增加手机号码
if ($request->input('pay_type') == 'citpay') {
if (!$request->input('mobile')) {
return $this->msg(['msg' => '手机号码不能为空']);
return $this->msg(['error' => 1,'msg' => '手机号码不能为空']);
}
if ($request->input('mobile')) {
if (!preg_match("/^1\d{10}$/", $request->input('mobile'))) {
return $this->msg(['msg' => '手机号码格式不正确不能为空']);
return $this->msg(['error' => 1,'msg' => '手机号码格式不正确不能为空']);
}
}
if ($request->input('money') < 100) {
return $this->msg(['msg' => '当前支付通道最低100元']);
return $this->msg(['error' => 1,'msg' => '当前支付通道最低100元']);
}
}
//取得商户信息

View File

@ -762,6 +762,9 @@ trait PayTrait
public function msg($data)
{
//临时测试一下看看是否可行
return response()->json($data);
if (request()->ajax()) {
return response()->json($data);
}