|
@@ -14,8 +14,52 @@ use Easemob\User;
|
|
|
|
|
|
class Qc extends Base {
|
|
|
|
|
|
+
|
|
|
+ function express_search(){
|
|
|
+ $uid = $this->uid;
|
|
|
+ $type = input('type',1);
|
|
|
+ $id = input('id');
|
|
|
+ if(empty($id)) $this->error('参数错误');
|
|
|
+
|
|
|
+ $order_info = Db::name($type == 1 ? 'exchange_order' : 'magic_order')->field('express_send_no')->where('id',$id)->where('uid',$uid)->find();
|
|
|
+
|
|
|
+ if(empty($order_info['express_send_no'])){
|
|
|
+ $this->error('订单信息有误');
|
|
|
+ }
|
|
|
+ $host = "https://wuliu.market.alicloudapi.com";//api访问链接
|
|
|
+ $path = "/kdi";//API访问后缀
|
|
|
+ $method = "GET";
|
|
|
+ $appcode = "43e8ad1f62ed42d8ac3c724d58e0e794";//开通服务后 买家中心-查看AppCode
|
|
|
+ $headers = array();
|
|
|
+ array_push($headers, "Authorization:APPCODE " . $appcode);
|
|
|
+ $querys = "no=".$order_info['express_send_no']; //参数写在这里
|
|
|
+ $bodys = "";
|
|
|
+ $url = $host . $path . "?" . $querys;
|
|
|
+ $curl = curl_init();
|
|
|
+ curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
|
|
|
+ curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
+ curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
|
|
+ curl_setopt($curl, CURLOPT_FAILONERROR, false);
|
|
|
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
|
|
+ curl_setopt($curl, CURLOPT_HEADER, false);
|
|
|
+ if (1 == strpos("$" . $host, "https://")) {
|
|
|
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
+ }
|
|
|
+ $out_put = curl_exec($curl);
|
|
|
+ if($out_put){
|
|
|
+ $res = json_decode($out_put,true);
|
|
|
+ $this->success('获取成功',$res['result']);
|
|
|
+ }else{
|
|
|
+ $this->success('暂无快递信息');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function index()
|
|
|
{
|
|
|
+ $type = 1;
|
|
|
+ $order_info = Db::name($type == 1 ? 'valid_date' : 'store_member')->field('express_send_no')->where('id',65)->find();
|
|
|
+ var_dump($order_info);
|
|
|
die();
|
|
|
$user_info = [];
|
|
|
if($user_info['pid'] > 0) {
|