OrderController 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Http\Controllers\Client;
  3. use App\Http\Controllers\Controller;
  4. use App\Services\Client\OrderService;
  5. use Illuminate\Http\Request;
  6. use Illuminate\Support\Facades\Auth;
  7. /**
  8. * @group 技师端
  9. *
  10. * 订单相关的API接口
  11. */
  12. class OrderController extends Controller
  13. {
  14. // protected OrderService $service;
  15. // public function __construct(OrderService $service)
  16. // {
  17. // $this->service = $service;
  18. // }
  19. /**
  20. * [订单]获取可抢订单列表
  21. *
  22. * 获取可抢订单列表
  23. *
  24. * @authenticated
  25. *
  26. * @queryParam area_code string required 区划代码. Example: 370602
  27. * @queryParam page int 页码. Example: 1
  28. * @queryParam per_page int 每页数量. Example: 10
  29. *
  30. * @response {
  31. * "data": [
  32. * {
  33. * "id": 1,
  34. * "order_no": "202403210001",
  35. * "project_name": "项目名称",
  36. * "project_duration": 60,
  37. * "project_price": "188.00",
  38. * "address": "山东省烟台市芝罘区",
  39. * "distance": 2.5,
  40. * "service_time": "2024-03-21 10:00:00",
  41. * "created_at": "2024-03-21 09:30:00"
  42. * }
  43. * ],
  44. * "meta": {
  45. * "total": 100,
  46. * "per_page": 10,
  47. * "current_page": 1,
  48. * "last_page": 10
  49. * }
  50. * }
  51. */
  52. public function getGrabList(Request $request)
  53. {
  54. $params = $request->only(['area_code', 'page', 'per_page']);
  55. return $this->service->getGrabList(Auth::user()->id, $params);
  56. }
  57. }