OrderSendController.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. namespace hd\controllers;
  3. use bizHd\order\services\OrderSendService;
  4. use bizHd\order\services\OrderService;
  5. use Yii;
  6. use common\components\util;
  7. class OrderSendController extends BaseController
  8. {
  9. //发货 ssh 2019.12.16
  10. public function actionDetail()
  11. {
  12. $id = Yii::$app->request->get('id', 0);
  13. $order = OrderService::getById($id);
  14. OrderService::valid($order, $this->shopId);
  15. $list = OrderSendService::sendList($order);
  16. util::success($list);
  17. }
  18. //制单 免填单 填单 ssh 2019.12.16
  19. public function actionPrintOrder()
  20. {
  21. $post = Yii::$app->request->post();
  22. $id = isset($post['id']) ? $post['id'] : 0;
  23. $option = isset($post['option']) ? $post['option'] : 0;
  24. $order = OrderService::getById($id);
  25. OrderService::valid($order, $this->shopId);
  26. $orderSn = $order['orderSn'];
  27. OrderSendService::printOrder(['id' => $id, 'option' => $option, 'orderSn' => $orderSn]);
  28. }
  29. //发货 ssh 2019.12.17
  30. public function actionDeliver()
  31. {
  32. $post = Yii::$app->request->post();
  33. $id = isset($post['id']) ? $post['id'] : 0;
  34. $order = OrderService::getById($id);
  35. OrderService::valid($order, $this->shopId);
  36. $post['merchantId'] = $this->sjId;
  37. $post['orderSn'] = $order['orderSn'];
  38. OrderSendService::deliver($post);
  39. }
  40. //送达 ssh 2019.12.17
  41. public function actionReach()
  42. {
  43. $post = Yii::$app->request->post();
  44. $id = isset($post['id']) ? $post['id'] : 0;
  45. $option = isset($post['option']) ? $post['option'] : 0;
  46. $order = OrderService::getById($id);
  47. OrderService::valid($order, $this->shopId);
  48. OrderSendService::reach($order, ['option' => $option]);
  49. }
  50. //向快递公司发起配送需求
  51. public function actionExpress()
  52. {
  53. }
  54. //取消快递
  55. public function actionCancelExpress()
  56. {
  57. $sendSide = 1;
  58. $sendTime = '10:21';
  59. }
  60. //添加小费
  61. public function actionAddTip()
  62. {
  63. }
  64. //结果回调通知
  65. public function actionExpressCallback()
  66. {
  67. }
  68. //快递服务提供方
  69. public function actionExpressProvide()
  70. {
  71. $data = ['id' => 1, 'name' => '达达'];
  72. util::success($data);
  73. }
  74. }