作者 王智

xiugai

@@ -255,4 +255,49 @@ class GuanYiCloud extends Api @@ -255,4 +255,49 @@ class GuanYiCloud extends Api
255 } 255 }
256 return $arr; 256 return $arr;
257 } 257 }
  258 +
  259 + //获取订单oid
  260 + public function GetOrderOid()
  261 + {
  262 + $OrderSn = input('order');
  263 + $data = array();
  264 + $data['appkey'] = APPKEY;
  265 + $data['sessionkey'] = SESSIONKEY;
  266 + $data['method'] = 'gy.erp.trade.get';
  267 + $data['platform_code'] = $OrderSn;
  268 + // $date['receiver_mobile']='15928552965';
  269 + $data['sign'] = $this->sign($data, SECRET);
  270 + $Array = json_decode(json_encode(json_decode($this->mycurl(URL, $data))), true);
  271 + //验证
  272 + if (empty($Array['orders'])) {
  273 + $this->error('获取订单失败:平台单号' . $OrderSn);
  274 + }
  275 + dump($Array);
  276 +// $delivery_state = $Array['orders'][0]['delivery_state'];
  277 +// $refund = $Array['orders'][0]['details'][0]['refund'];
  278 +// $platform_code = $Array['orders'][0]['platform_code'];
  279 +// if (!empty($Array['orders'][0]['deliverys'])) {
  280 +// $express_name = $Array['orders'][0]['deliverys'][0]['express_name'];
  281 +// $express_code = $Array['orders'][0]['deliverys'][0]['express_code'];
  282 +// $mail_no = $Array['orders'][0]['deliverys'][0]['mail_no'];
  283 +// } else {
  284 +// $express_name = '';
  285 +// $express_code = '';
  286 +// $mail_no = '';
  287 +// }
  288 +// $Return = [
  289 +// //发货状态 0-未发货//1-部分发货//2-全部发货
  290 +// 'delivery_state' => $delivery_state,
  291 +// //平台单号
  292 +// 'platform_code' => $platform_code,
  293 +// //快递公司名称
  294 +// 'express_name' => $express_name,
  295 +// //快递公司代码
  296 +// 'express_code' => $express_code,
  297 +// //快递单号
  298 +// 'mail_no' => $mail_no
  299 +// ];
  300 +// $Json = json_encode($Return);
  301 +// return $Json;
  302 + }
258 } 303 }