Bills.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\controller\admin;
  3. use app\extra\basic\Base;
  4. use app\middleware\AuthMiddleware;
  5. use app\service\saas\BillDayService;
  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. #[Controller("/api/bills"),Middleware(AuthMiddleware::class)]
  13. class Bills extends Base
  14. {
  15. #[Inject]
  16. protected BillDayService $serviceDay;
  17. #[GetMapping('list')]
  18. public function getDataList(Request $request): Response
  19. {
  20. try {
  21. $param = $request->all();
  22. $data = $this->serviceDay->setModel()->getList($param,['store' => function($query){
  23. $query->field("poi_id,poi_name,poi_address,nick_name,poi_city");
  24. }]);
  25. return successTrans("success.data",pageFormat($data),200);
  26. } catch (\Throwable $throwable) {
  27. return error($throwable->getMessage());
  28. }
  29. }
  30. }