diff --git a/app/Constants/v3/Shipping.php b/app/Constants/v3/Shipping.php index 52e7a47..4978a7b 100644 --- a/app/Constants/v3/Shipping.php +++ b/app/Constants/v3/Shipping.php @@ -15,6 +15,11 @@ class Shipping extends AbstractConstants */ const TYPE_LANZU = 1; + /** + * @Message("达达配送") + */ + const TYPE_DADA = 2; + /** * @Message("用户自提") */ diff --git a/app/Service/v3/Implementations/FeiePrintService.php b/app/Service/v3/Implementations/FeiePrintService.php index f7d9756..f721a59 100644 --- a/app/Service/v3/Implementations/FeiePrintService.php +++ b/app/Service/v3/Implementations/FeiePrintService.php @@ -2,6 +2,7 @@ namespace App\Service\v3\Implementations; +use App\Constants\v3\Shipping; use App\Libs\FeiePrintClient; use App\Model\v3\Feprint; use App\Model\v3\OrderMain; @@ -123,7 +124,7 @@ class FeiePrintService implements FeiePrintServiceInterface $goodsTotal = bcmul($goods->number,$goods->price,2); $priceLen = mb_strwidth($goods->price); $totalLen = mb_strwidth($goodsTotal); - if($nameLength > ($B+$C+$D-$priceLen-$totalLen)){ + if($nameLength >= ($B+$C+$D-$priceLen-$totalLen)){ $orderInfo .= '
'; $orderInfo .= str_pad($goods->price,$A+$B+$C,' ',STR_PAD_LEFT); }else{ @@ -168,9 +169,14 @@ class FeiePrintService implements FeiePrintServiceInterface $orderInfo .= str_pad($userName,$A+$B+$userLength,' ',STR_PAD_RIGHT); $orderInfo .= str_pad($total,$C+$D+$totalLength+1,' ',STR_PAD_LEFT); $orderInfo .= '
'; - $orderInfo .= '送货地点:' . $arr->address . '
'; - $tel = substr_replace( $arr->tel, '****', 3, 4); - $orderInfo .= '联系电话:' . $tel . '
'; + $orderInfo .= '配送方式:' . $arr->shipping_type_text . '
'; + if($arr->shipping_type != Shipping::TYPE_SELF_TAKE){ + $orderInfo .= '送货地点:' . $arr->address . '
'; + } + if(!empty($arr->tel)){ + $tel = substr_replace( $arr->tel, '****', 3, 4); + $orderInfo .= '联系电话:' . $tel . '
'; + } $orderInfo .= '下单时间:' . $arr->pay_time_text . '
'; $orderInfo .= '送达时间:' . $arr->delivery_time_note . '
'; //$orderInfo .= 'http://www.feieyun.com';//把解析后的二维码生成的字符串用标签套上即可自动生成二维码 diff --git a/app/Service/v3/Interfaces/FeiePrintServiceInterface.php b/app/Service/v3/Interfaces/FeiePrintServiceInterface.php index f42bf28..0f765e3 100644 --- a/app/Service/v3/Interfaces/FeiePrintServiceInterface.php +++ b/app/Service/v3/Interfaces/FeiePrintServiceInterface.php @@ -6,5 +6,5 @@ namespace App\Service\v3\Interfaces; interface FeiePrintServiceInterface { - public function feiePrint($order_num); + public function feiePrint($globalOrderId); } \ No newline at end of file