|
@@ -588,18 +588,25 @@ class TradeOrderService extends BaseService
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $orderInfo = $this->model->where(['user_id' => $userId, 'id' => $orderId, 'mark' => 1, 'type' => 1])
|
|
|
|
|
|
|
+ $orderInfo = $this->model->where(['id' => $orderId, 'mark' => 1, 'type' => 1])
|
|
|
->whereIn('status', [1, 2, 5, 7])
|
|
->whereIn('status', [1, 2, 5, 7])
|
|
|
- ->select(['id', 'order_no','api_id', 'business_id', 'type', 'payment_id', 'num', 'total', 'status'])
|
|
|
|
|
|
|
+ ->select(['id', 'order_no','api_id','user_id', 'business_id', 'type','trade_type', 'payment_id', 'num', 'total', 'status'])
|
|
|
->first();
|
|
->first();
|
|
|
- $tradeType = isset($orderInfo['type']) ? $orderInfo['type'] : 0;
|
|
|
|
|
|
|
+ $type = isset($orderInfo['type']) ? $orderInfo['type'] : 0;
|
|
|
|
|
+ $tradeType = isset($orderInfo['trade_type']) ? $orderInfo['trade_type'] : 0;
|
|
|
$apiId = isset($orderInfo['api_id']) ? $orderInfo['api_id'] : 0;
|
|
$apiId = isset($orderInfo['api_id']) ? $orderInfo['api_id'] : 0;
|
|
|
- //var_dump($orderInfo);
|
|
|
|
|
|
|
+ $orderUserId = isset($orderInfo['user_id']) ? $orderInfo['user_id'] : 0;
|
|
|
if (empty($orderInfo)) {
|
|
if (empty($orderInfo)) {
|
|
|
$this->error = '3016';
|
|
$this->error = '3016';
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if ($tradeType != 1) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if($tradeType == 3 && ($userId<=0 || $orderUserId != $userId)){
|
|
|
|
|
+ $this->error = '6012';
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($type != 1) {
|
|
|
$this->error = '3024';
|
|
$this->error = '3024';
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|