OrderSendController.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace ghs\controllers;
  3. use bizGhs\order\services\OrderSendService;
  4. use bizGhs\order\services\OrderService;
  5. use Yii;
  6. use common\components\util;
  7. class OrderSendController extends BaseController
  8. {
  9. //发货 shish 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->merchantId);
  15. //发货列表
  16. $list = OrderSendService::sendList($order);
  17. util::success($list);
  18. }
  19. //制单 免填单 填单 shish 2019.12.16
  20. public function actionPrintOrder()
  21. {
  22. $post = Yii::$app->request->post();
  23. $id = isset($post['id']) ? $post['id'] : 0;
  24. $option = isset($post['option']) ? $post['option'] : 0;
  25. $order = OrderService::getById($id);
  26. OrderService::valid($order, $this->merchantId);
  27. OrderSendService::printOrder(['id' => $id, 'option' => $option]);
  28. }
  29. //发货 shish 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->merchantId);
  36. $post['merchantId'] = $this->merchantId;
  37. OrderSendService::deliver($post);
  38. }
  39. //送达 shish 2019.12.17
  40. public function actionReach()
  41. {
  42. $post = Yii::$app->request->post();
  43. $id = isset($post['id']) ? $post['id'] : 0;
  44. $option = isset($post['option']) ? $post['option'] : 0;
  45. $order = OrderService::getById($id);
  46. OrderService::valid($order, $this->merchantId);
  47. OrderSendService::reach($order, ['option' => $option]);
  48. }
  49. }