SoccerLeague.php 705 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Jonlin
  5. * Date: 2019/3/29
  6. * Time: 9:27
  7. */
  8. namespace App\Models;
  9. use Illuminate\Support\Facades\DB;
  10. class SoccerLeague extends BaseModel {
  11. protected $table = "st_zq_league";
  12. public $timestamps = false;
  13. //所有赛事id
  14. function allleague()
  15. {
  16. $data = $this->select('lg_id','name_chinese')->get();
  17. if (!$data) {
  18. return -5040000102; //无相关信息
  19. }
  20. return $data->toArray();
  21. }
  22. //赛事信息
  23. function onlyleague($lg_id){
  24. $data=$this->where('lg_id',$lg_id)->first();
  25. if (!$data) {
  26. return -5040000102; //无相关信息
  27. }
  28. return $data->toArray();
  29. }
  30. }