|
@@ -4,39 +4,58 @@ class Model_express_tt extends Lin_Model {
|
|
|
parent::__construct();
|
|
|
$this->load->_model("Model_apitt","apitt");
|
|
|
}
|
|
|
- public function getData($info){
|
|
|
+
|
|
|
+
|
|
|
+ public function getData($info,$type = 'CBT'){
|
|
|
if(empty($info)){
|
|
|
- return $g = [
|
|
|
- 'x'=>0,
|
|
|
- 'Description'=>'订单信息不存在',
|
|
|
- ];
|
|
|
- }
|
|
|
- $shop_info = $this->db->from('shop')->where('id', $info['shop'])->get()->result_array();
|
|
|
-
|
|
|
- if(empty($shop_info)){
|
|
|
+ return $g = [
|
|
|
+ 'x'=>0,
|
|
|
+ 'Description'=>'订单信息不存在',
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $shop_info = $this->db->from('shop')->where('id', $info['shop'])->get()->result_array();
|
|
|
+
|
|
|
+ if(empty($shop_info)){
|
|
|
+ return [
|
|
|
+ 'x'=>0,
|
|
|
+ 'Description'=>'该商铺不存在',
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if($type == 'CBT'){
|
|
|
+
|
|
|
+ //获取快递服务信息
|
|
|
+ $res = $this->getExpressCompany($info,$shop_info[0]);
|
|
|
+ if($res['x'] == 0){
|
|
|
+ return $res;
|
|
|
+ }
|
|
|
+ $res1 = $this->createExpressLabel($res['data'],$shop_info[0]);
|
|
|
+ if($res1['x'] == 0){
|
|
|
+ return $res1;
|
|
|
+ }
|
|
|
+ $res2 = $this->downloadExpressLabel($res['data'],$shop_info[0]);
|
|
|
+ if($res2['x'] == 0){
|
|
|
+ return $res2;
|
|
|
+ }
|
|
|
+ return [
|
|
|
+ 'x'=>1,
|
|
|
+ 'msg'=>'获取成功',
|
|
|
+ 'data'=>$info
|
|
|
+ ];
|
|
|
+ }else if($type == 'FBT'){
|
|
|
+ $res = $this->apitt->get_data([$info['orderinfo']],$shop_info[0]);
|
|
|
+ echo "<pre>";
|
|
|
+ print_r($res);
|
|
|
+ die;
|
|
|
+ }else{
|
|
|
return [
|
|
|
'x'=>0,
|
|
|
- 'Description'=>'该商铺不存在',
|
|
|
+ 'Description'=>'暂不支持该快递类型',
|
|
|
];
|
|
|
}
|
|
|
- //获取快递服务信息
|
|
|
- $res = $this->getExpressCompany($info,$shop_info[0]);
|
|
|
- if($res['x'] == 0){
|
|
|
- return $res;
|
|
|
- }
|
|
|
- $res1 = $this->createExpressLabel($res['data'],$shop_info[0]);
|
|
|
- if($res1['x'] == 0){
|
|
|
- return $res1;
|
|
|
- }
|
|
|
- $res2 = $this->downloadExpressLabel($res['data'],$shop_info[0]);
|
|
|
- if($res2['x'] == 0){
|
|
|
- return $res2;
|
|
|
- }
|
|
|
- return [
|
|
|
- 'x'=>1,
|
|
|
- 'msg'=>'获取成功',
|
|
|
- 'data'=>$info
|
|
|
- ];
|
|
|
+
|
|
|
+ }
|
|
|
+ private function getOrderDetail($info,$shop_info){
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//获取订单承运的快递商
|