-
Notifications
You must be signed in to change notification settings - Fork 3
/
OutStoreAddOrder1.php
58 lines (42 loc) · 1.33 KB
/
OutStoreAddOrder1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
include 'include/config.php';
error_reporting(E_ALL);
$api_address = 'http://yewu.chukou1.cn/client/ws/v2.1/ck1.asmx?wsdl';
$token = $ckytoken;
$user_key = $ckyuserkey;
$soap_client = new SoapClient($api_address);
$ids = substr($_REQUEST['ebay_id'],1);
$OrderDetail = array();
$sql = "select ebay_id,cky_item from ebay_order where ebay_id in ($ids) and ebay_user='$user' ";
$sql = $dbcon->execute($sql);
$sql = $dbcon->getResultArray($sql);
//print_r($sql);
foreach($sql as $k=>$v){
$ebay_id = $v['ebay_id'];
$request = array
(
'request' => array
(
'Token' => $token, //系统验证字符串
'UserKey' => $user_key, //第三方验证字符串
'Sign' => $v['cky_item'],
//'MessageID' => $ebay_id, //客户请求号(可不填)
)
);
//print_r($request);
$result = $soap_client->OutStoreGetPackage($request);
//print_r($result);
if($result->OutStoreGetPackageResult->Ack == 'Success'){
$states = $result->OutStoreGetPackageResult->PackageDetail->State;
//if($states == 'Delivered'){
$tracknumber = $result->OutStoreGetPackageResult->PackageDetail->TrackingNumber;
if($tracknumber){
$updatesql = "update ebay_order set ebay_tracknumber = '$tracknumber' where ebay_id='$ebay_id'";
echo $updatesql;
$dbcon->execute($updatesql);
echo $ebay_id.'订单状态为已完成 获取跟踪号成功!<br>';
}
// }
}
}
?>