NewPc.php 817 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Http\Controllers\api;
  3. use App\Models\PcIssue;
  4. class NewPc extends BaseController
  5. {
  6. /**
  7. * @api {get} /newPc/yuanTou 源头
  8. * @apiGroup newPc
  9. * @apiVersion 1.0.0
  10. * @apiSuccess {int} code
  11. * @apiSuccess {int} timestamp
  12. * @apiSuccess {String} msg
  13. * @apiSuccess {Object[]} data
  14. *
  15. */
  16. function yuanTou()
  17. {
  18. $page = request()->input('page', 1);
  19. $limit = request()->input('limit', 20);
  20. $data = PcIssue::where('status', PcIssue::STATUS_DRAW)
  21. ->forPage($page, $limit)
  22. ->orderByDesc('issue_no')
  23. ->get();
  24. foreach ($data as &$item) {
  25. $item['keno'] = json_decode($item['keno'], true);
  26. sort($item['keno']);
  27. }
  28. return $this->success($data);
  29. }
  30. }