Egame_match.php 655 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Models;
  3. class Egame_match extends BaseModel {
  4. protected $table = "egame_match";
  5. public $timestamps = false;
  6. //获取赛事信息
  7. protected function getMatchList($where,$list=10){
  8. $data=$this->orderBy('id','desc');
  9. if(is_array($where)&&count($where)>0){
  10. $data=$data->where($where);
  11. }
  12. $data=$data->paginate($list);
  13. return $data->toArray();
  14. }
  15. //获取赛事信息
  16. protected function getInfoByID($id){
  17. $data=$this->where('id',$id)->first();
  18. if(!$data){
  19. return -9040410122;//没有信息
  20. }
  21. return $data->toArray();
  22. }
  23. }