|
|
@@ -327,10 +327,52 @@ class ShunfengAdapter extends Shunfeng implements Adapter
|
|
|
|
|
|
/**
|
|
|
* 查询订单状态
|
|
|
+ * @param array $data
|
|
|
+ * @return array
|
|
|
*/
|
|
|
- public function selectOrder($data)
|
|
|
+ public function selectOrder($orderId)
|
|
|
{
|
|
|
+ if (empty($orderId)) {
|
|
|
+ return [
|
|
|
+ 'code' => -1,
|
|
|
+ 'platform' => 'shunfeng',
|
|
|
+ 'msg' => 'order_id不能为空',
|
|
|
+ 'data' => null,
|
|
|
+ ];
|
|
|
+ }
|
|
|
|
|
|
+ $payload = [
|
|
|
+ 'order_id' => $orderId,
|
|
|
+ 'push_time' => time(),
|
|
|
+ ];
|
|
|
+
|
|
|
+ if (isset($data['order_type'])) {
|
|
|
+ $payload['order_type'] = (int)$data['order_type'];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!empty($data['shop_id'])) {
|
|
|
+ $payload['shop_id'] = $data['shop_id'];
|
|
|
+ }
|
|
|
+ if (isset($data['shop_type'])) {
|
|
|
+ $payload['shop_type'] = (int)$data['shop_type'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $resp = $this->httpRequest('getorderstatus', $payload);
|
|
|
+
|
|
|
+ if (isset($resp['error_code']) && $resp['error_code'] == 0 && isset($resp['result'])) {
|
|
|
+ return [
|
|
|
+ 'code' => 0,
|
|
|
+ 'platform' => 'shunfeng',
|
|
|
+ 'data' => $resp['result']
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ return [
|
|
|
+ 'code' => (int)($resp['error_code'] ?? -1),
|
|
|
+ 'platform' => 'shunfeng',
|
|
|
+ 'msg' => $resp['error_msg'] ?? '查询订单状态失败',
|
|
|
+ 'data' => null
|
|
|
+ ];
|
|
|
}
|
|
|
|
|
|
/**
|