IndexController.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace App\Http\Controllers\Api\V1\Specialist;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Http\Request;
  5. use App\Facades\SpecialistCloumnFacade;
  6. use App\Models\SpecialistCloumn;
  7. class IndexController extends Controller
  8. {
  9. /**
  10. * Display a listing of the resource.
  11. *
  12. * @return \Illuminate\Http\Response
  13. */
  14. public function index()
  15. {
  16. $conditions = [
  17. 'pid' => request('pid', SpecialistCloumn::PID_0),
  18. 'is_show' => SpecialistCloumn::IS_SHOW_1
  19. ];
  20. $fields = ['*'];
  21. $sort = '`rank` desc';
  22. $page = request('page', 1);
  23. $limit = request('limit', 20);
  24. return SpecialistCloumnFacade::getList($conditions, $fields, $sort, $page, $limit);
  25. }
  26. /**
  27. * Store a newly created resource in storage.
  28. *
  29. * @param \Illuminate\Http\Request $request
  30. * @return \Illuminate\Http\Response
  31. */
  32. public function store(Request $request)
  33. {
  34. //
  35. }
  36. /**
  37. * Display the specified resource.
  38. *
  39. * @param int $id
  40. * @return \Illuminate\Http\Response
  41. */
  42. public function show($id)
  43. {
  44. $conditions = [
  45. 'id' => $id
  46. ];
  47. return SpecialistCloumnFacade::findBy($conditions, ['*']);
  48. }
  49. /**
  50. * Update the specified resource in storage.
  51. *
  52. * @param \Illuminate\Http\Request $request
  53. * @param int $id
  54. * @return \Illuminate\Http\Response
  55. */
  56. public function update(Request $request, $id)
  57. {
  58. //
  59. }
  60. /**
  61. * Remove the specified resource from storage.
  62. *
  63. * @param int $id
  64. * @return \Illuminate\Http\Response
  65. */
  66. public function destroy($id)
  67. {
  68. //
  69. }
  70. }