HomeMatch.php 959 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Sports\Controller;
  3. use BaseController\Controller;
  4. /**
  5. * Class HomeMatch
  6. * @package App\Sports\Controller
  7. * User: tank
  8. * Date: 2019/3/21
  9. */
  10. class HomeMatch extends Controller {
  11. /**
  12. * @throws \Exception
  13. * 获取首页 特色赛事数据
  14. */
  15. public function highMatch (){
  16. $ret = lm("st_zq_competition","Sports")
  17. ->join('st_zq_league','st_zq_league.id','=','st_zq_competition.lg_id')
  18. ->select('st_zq_league.id as lg_id','st_zq_league.name_chinese','st_zq_competition.id as match_id','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time')
  19. ->limit(3)
  20. ->where('recommend',1)
  21. ->get();
  22. $data = [
  23. 'title' => '特色赛事',
  24. 'matchData' => $ret
  25. ];
  26. if(!empty($ret)) Render($data, '1', lang('Tips','Sports')->get('success'));
  27. }
  28. }