|
|
@@ -126,6 +126,16 @@ class Model_express_tt extends Lin_Model {
|
|
|
private function getFBTPackage($info,$shop_info){
|
|
|
$extra_text = $info['extra_text'];
|
|
|
$packages = $extra_text['packages'];
|
|
|
+ if(!isset($extra_text['server_info'])){
|
|
|
+ $rr1 = $this->getExpressCompany($info,$shop_info);
|
|
|
+ if($rr1['x'] == 0){
|
|
|
+ return $rr1;
|
|
|
+ }
|
|
|
+ $info = $rr1['data'];
|
|
|
+ if(is_string($info['extra_text'])){
|
|
|
+ $info['extra_text'] = json_decode($info['extra_text'],true);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 确定没有多包裹的情况 就不再写循环了 直接获取第一个包裹
|
|
|
// foreach($packages as $package){
|
|
|
// $rr = $this->apitt->downloadLabel($package['id'],$shop_info[0],$info);
|
|
|
@@ -139,6 +149,17 @@ class Model_express_tt extends Lin_Model {
|
|
|
// ];
|
|
|
// }
|
|
|
// }
|
|
|
+
|
|
|
+ if(!isset($extra_text['label_info'])){
|
|
|
+ $rr2 = $this->createExpressLabel($info,$shop_info);
|
|
|
+ if($rr2['x'] == 0){
|
|
|
+ return $rr2;
|
|
|
+ }
|
|
|
+ $info = $rr2['data'];
|
|
|
+ if(is_string($info['extra_text'])){
|
|
|
+ $info['extra_text'] = json_decode($info['extra_text'],true);
|
|
|
+ }
|
|
|
+ }
|
|
|
$packageid = $packages[0]['id'];
|
|
|
$rr = $this->apitt->downloadLabel($packageid,$shop_info[0],$info);
|
|
|
if($rr['code']!=0){
|