Delivery.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\common\service\message\order;
  13. use app\common\service\message\Basics;
  14. use app\common\model\store\Setting as SettingModel;
  15. /**
  16. * 消息通知服务 [订单发货]
  17. * Class Delivery
  18. * @package app\common\service\message\order
  19. */
  20. class Delivery extends Basics
  21. {
  22. /**
  23. * 参数列表
  24. * @var array
  25. */
  26. protected $param = [
  27. 'order' => [],
  28. ];
  29. /**
  30. * 订单页面链接
  31. * @var string
  32. */
  33. private $pageUrl = 'pages/order/detail';
  34. /**
  35. * 发送消息通知
  36. * @param array $param
  37. * @return mixed|void
  38. * @throws \think\Exception
  39. */
  40. public function send(array $param)
  41. {
  42. // 记录参数
  43. $this->param = $param;
  44. }
  45. /**
  46. * 格式化物流公司
  47. * @param $orderInfo
  48. * @return mixed
  49. */
  50. private function getFormatExpressName($orderInfo)
  51. {
  52. return $this->getSubstr($orderInfo['express']['express_name']);
  53. }
  54. /**
  55. * 格式化用户收货地址
  56. * @param $orderInfo
  57. * @return string
  58. */
  59. private function getFormatAddress($orderInfo)
  60. {
  61. return implode('', $orderInfo['address']['region']) . $orderInfo['address']['detail'];
  62. }
  63. /**
  64. * 格式化商品名称
  65. * @param $goodsData
  66. * @return string
  67. */
  68. private function getFormatGoodsName($goodsData)
  69. {
  70. return $this->getSubstr($goodsData[0]['goods_name']);
  71. }
  72. }