|
|
@@ -169,8 +169,15 @@ class Taxi extends ApiController
|
|
|
$params['order_no'] = get_order_no();
|
|
|
$params['user_id'] = $user['id'];
|
|
|
|
|
|
- $order = model('common/TaxiOrder')::create($params,true);
|
|
|
- //
|
|
|
+ // 验证是否有未支付订单,有则直接更新订单为新订单
|
|
|
+ $hasOrderId = model('common/TaxiOrder')->where(['user_id'=> $user['id'],'status'=> 1])->value('id');
|
|
|
+ if($hasOrderId){
|
|
|
+ model('common/TaxiOrder')->updateBy($hasOrderId, $params);
|
|
|
+ }else{
|
|
|
+ $order = model('common/TaxiOrder')::create($params,true);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 订单信息验证处理
|
|
|
if ($order){
|
|
|
// 创建对应支付记录
|
|
|
$trade_no = get_order_no();
|