OrderSendController.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. $order = OrderService::getById($id);
  46. OrderService::valid($order, $this->shopId);
  47. OrderSendService::reach($order);
  48. }
  49. //向快递公司发起配送需求
  50. public function actionExpress()
  51. {
  52. }
  53. //取消快递
  54. public function actionCancelExpress()
  55. {
  56. $sendSide = 1;
  57. $sendTime = '10:21';
  58. }
  59. //添加小费
  60. public function actionAddTip()
  61. {
  62. }
  63. //结果回调通知
  64. public function actionExpressCallback()
  65. {
  66. }
  67. //快递服务提供方
  68. public function actionExpressProvide()
  69. {
  70. $data = ['id' => 1, 'name' => '达达'];
  71. util::success($data);
  72. }
  73. }