Export.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\v1\serve;
  12. use app\adminapi\controller\AuthController;
  13. use app\services\serve\ServeServices;
  14. use app\services\shipping\ExpressServices;
  15. use think\facade\App;
  16. /**
  17. * 一号通平台物流服务
  18. * Class Export
  19. * @package app\adminapi\controller\v1\serve
  20. */
  21. class Export extends AuthController
  22. {
  23. /**
  24. * Export constructor.
  25. * @param App $app
  26. * @param ExpressServices $services
  27. */
  28. public function __construct(App $app, ExpressServices $services)
  29. {
  30. parent::__construct($app);
  31. $this->services = $services;
  32. }
  33. /**
  34. * 物流公司
  35. * @return mixed
  36. */
  37. public function getExportAll()
  38. {
  39. return app('json')->success($this->services->expressList());
  40. }
  41. /**
  42. *
  43. * 获取面单信息
  44. * @param string $com
  45. * @return mixed
  46. */
  47. public function getExportTemp(ServeServices $services)
  48. {
  49. [$com] = $this->request->getMore([
  50. ['com', ''],
  51. ], true);
  52. return app('json')->success($services->express()->temp($com));
  53. }
  54. /**
  55. * 打印电子面单是否开启
  56. * @return mixed
  57. */
  58. public function dumpIsOpen(ServeServices $services)
  59. {
  60. $userInfo = $services->user()->getUser();
  61. $res = false;
  62. if ($userInfo['dump']['open']) {
  63. $res = true;
  64. if (!sys_config('config_export_siid')
  65. && !sys_config('config_export_com')
  66. && !sys_config('config_export_to_name')
  67. && !sys_config('config_export_to_tel')
  68. && !sys_config('config_export_to_address')
  69. ) {
  70. $res = false;
  71. }
  72. }
  73. return app('json')->success(['isOpen' => $res]);
  74. }
  75. /**
  76. * @param ServeServices $services
  77. * @return \think\Response
  78. * @author 等风来
  79. * @email 136327134@qq.com
  80. * @date 2023/5/15
  81. */
  82. public function getShipmentOrderList(ServeServices $services)
  83. {
  84. $where = $this->request->getMore([
  85. ['page', 1],
  86. ['limit', 10],
  87. ]);
  88. return app('json')->success($services->express()->getShipmentOrderList($where));
  89. }
  90. }