ExpressController.php 846 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace addons\StarChain\api\modules\v1\controllers;
  3. use addons\StarChain\common\services\OrderService;
  4. use Yii;
  5. use api\controllers\OnAuthController;
  6. /**
  7. * 物流控制器
  8. *
  9. * Class ExpressController
  10. * @package addons\StarChain\api\modules\v1\controllers
  11. */
  12. class ExpressController extends OnAuthController
  13. {
  14. public $modelClass = '';
  15. /**
  16. * 查询物流
  17. *
  18. * @return string
  19. */
  20. public function actionSearch()
  21. {
  22. if ($this->request->isPost) {
  23. $order_id = $this->request->getBodyParam('order_id');
  24. $serivce = new OrderService(['mall_id' => $this->mall_id]);
  25. $data = $serivce->getOrderExpress($order_id);
  26. return $data !== false
  27. ? $this->success('ok', $data)
  28. : $this->error($serivce->error);
  29. }
  30. }
  31. }