OrderSendController.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace ghs\controllers;
  3. use bizGhs\order\classes\OrderClass;
  4. use bizGhs\order\classes\OrderSendClass;
  5. use bizGhs\order\services\OrderSendService;
  6. use bizGhs\order\services\OrderService;
  7. use Yii;
  8. use common\components\util;
  9. class OrderSendController extends BaseController
  10. {
  11. //发货 shish 2019.12.16
  12. public function actionDetail()
  13. {
  14. $id = Yii::$app->request->get('id', 0);
  15. $order = OrderService::getById($id);
  16. OrderService::valid($order, $this->merchantId);
  17. //发货列表
  18. $list = OrderSendService::sendList($order);
  19. util::success($list);
  20. }
  21. //发货 shish 2019.12.17
  22. public function actionDeliver()
  23. {
  24. $post = Yii::$app->request->post();
  25. $id = isset($post['id']) ? $post['id'] : 0;
  26. $order = OrderService::getById($id);
  27. OrderService::valid($order, $this->merchantId);
  28. $post['merchantId'] = $this->merchantId;
  29. OrderSendService::deliver($post);
  30. }
  31. //送达 shish 2019.12.17
  32. public function actionReach()
  33. {
  34. $post = Yii::$app->request->post();
  35. $id = isset($post['id']) ? $post['id'] : 0;
  36. $option = isset($post['option']) ? $post['option'] : 0;
  37. $order = OrderService::getById($id);
  38. OrderService::valid($order, $this->merchantId);
  39. OrderSendService::reach($order, ['option' => $option]);
  40. }
  41. }