Issue.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Http\Controllers\api;
  3. use App\Models\Cao;
  4. use App\Services\IssueService;
  5. class Issue extends BaseController
  6. {
  7. public function index()
  8. {
  9. $page = request()->input('page', 1);
  10. $limit = request()->input('limit', 10);
  11. $params = [
  12. 'page' => $page,
  13. 'limit' => $limit
  14. // 'status'=>3
  15. ];
  16. $res = IssueService::paginate($params);
  17. return $this->success($res);
  18. }
  19. public function cao()
  20. {
  21. $type = [1, 2, 3, 4];
  22. $list = [];
  23. $list[] = Cao::whereIn('id', $type)->get();
  24. $type = [5, 6, 7, 8];
  25. $list[] = Cao::whereIn('id', $type)->get();
  26. $type = [9,10];
  27. $list[] = Cao::whereIn('id', $type)->get();
  28. $list[] = [
  29. ['field'=>'2.8回本','val'=>0],
  30. ['field'=>'3.2回本','val'=>0],
  31. ];
  32. $type = [11,12,13];
  33. $list[] = Cao::whereIn('id', $type)->get();
  34. $list[] = Cao::where('id', '>=',14)
  35. ->where('id', '<=',41)
  36. ->get();
  37. return $this->success($list);
  38. }
  39. }