|
@@ -142,40 +142,37 @@ class CTCard implements IOpenCard
|
|
|
public function logistics_query($biz) : array
|
|
|
{
|
|
|
[$succ, $head, $biz] = $this->request('getLogisticsTrajectory', $biz, $net_errno);
|
|
|
- if($succ)
|
|
|
+ if ($succ)
|
|
|
{
|
|
|
$code = intval($biz["code"]);
|
|
|
$tracesList = $biz["tracesList"];
|
|
|
$msg = $head["err"];
|
|
|
- if($code == 0){
|
|
|
+ if ($code == 0) {
|
|
|
return [true, $tracesList];
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return [false, $msg];
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- return [false,'网络错误'];
|
|
|
+ else {
|
|
|
+ return [false, '网络错误'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function add_order($biz) : array
|
|
|
{
|
|
|
[$succ, $head, $biz] = $this->request('synOrderInfo', $biz, $net_errno);
|
|
|
- if($succ){
|
|
|
+ if ($succ)
|
|
|
+ {
|
|
|
$code = intval($head["code"]);
|
|
|
$orderCode = $biz["orderCode"];
|
|
|
$msg = $head["err"];
|
|
|
- if($code == 0){
|
|
|
+ if ($code == 0) {
|
|
|
return [true, $orderCode];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
return [false, $msg];
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ else {
|
|
|
return [false, "网络错误"];
|
|
|
}
|
|
|
}
|
|
@@ -183,18 +180,16 @@ class CTCard implements IOpenCard
|
|
|
public function order_info($order_sn) : array
|
|
|
{
|
|
|
[$succ, $head, $biz] = $this->request('queryOrderInfo', ['orderCode' => $order_sn], $net_errno);
|
|
|
- if($succ){
|
|
|
+ if($succ)
|
|
|
+ {
|
|
|
$code = intval($head["code"]);
|
|
|
- if($code == 0){
|
|
|
+ if ($code == 0) {
|
|
|
return [true, $biz];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
return [false, null];
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ else {
|
|
|
return [false, "网络错误"];
|
|
|
}
|
|
|
}
|