Express.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\controller\merchant;
  3. use app\extra\basic\Base;
  4. use app\middleware\AuthMiddleware;
  5. use app\service\saas\ExpressService;
  6. use DI\Attribute\Inject;
  7. use LinFly\Annotation\Attributes\Route\Controller;
  8. use LinFly\Annotation\Attributes\Route\GetMapping;
  9. use LinFly\Annotation\Attributes\Route\Middleware;
  10. use support\Request;
  11. use support\Response;
  12. /**
  13. * 发货记录
  14. */
  15. #[Controller("/api/merchant/express"),Middleware(AuthMiddleware::class)]
  16. class Express extends Base
  17. {
  18. #[Inject]
  19. protected ExpressService $service;
  20. #[GetMapping('list')]
  21. public function getDataList(Request $request): Response
  22. {
  23. try {
  24. $param = $request->all();
  25. if ($request->user['type'] == 2) {
  26. $param['poi_id'] = $request->user['store_id'];
  27. } else {
  28. $param['uid'] = $request->user['id'];
  29. }
  30. $data = $this->service->setModel()->getList($param);
  31. return successTrans(100010,pageFormat($data),200);
  32. } catch (\Throwable $th) {
  33. return error($th->getMessage());
  34. }
  35. }
  36. }