|
|
@@ -98,4 +98,72 @@ class BasketLeague extends BaseModel {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //测试冠军联赛数据
|
|
|
+ function get_league_gj_info($list = 10, $page, $where = '')
|
|
|
+ {
|
|
|
+ if (is_array ($where) && count ($where) > 0){
|
|
|
+ $data = $this
|
|
|
+ ->join('st_lq_odds','st_lq_odds.lg_id','=','st_lq_league.id')
|
|
|
+ ->select('st_lq_league.id','st_lq_league.name_chinese','st_lq_league.area_id','st_lq_league.country_id','st_lq_league.status','st_lq_league.utime')
|
|
|
+ ->orderby('st_lq_league.utime','desc')
|
|
|
+ ->where($where)
|
|
|
+ ->distinct('st_lq_league.name_chinese')
|
|
|
+ ->paginate ($list);
|
|
|
+ }else{
|
|
|
+ $data = $this
|
|
|
+ ->join('st_lq_odds','st_lq_odds.lg_id','=','st_lq_league.id')
|
|
|
+ ->select('st_lq_league.id','st_lq_league.name_chinese','st_lq_league.area_id','st_lq_league.country_id','st_lq_league.status','st_lq_league.utime')
|
|
|
+ ->where('st_lq_odds.type',1)
|
|
|
+ ->distinct('st_lq_league.name_chinese')
|
|
|
+ ->orderby('st_lq_league.utime','desc')
|
|
|
+ ->paginate ($list);
|
|
|
+ }
|
|
|
+ if (!$data) {
|
|
|
+ return -5040000102; //无相关信息
|
|
|
+ }
|
|
|
+ //地区
|
|
|
+ $area = \App\Models\StAreaCountry::where('pid','0')->get();
|
|
|
+
|
|
|
+ //国家
|
|
|
+ $country = \App\Models\StAreaCountry::where('pid','<>','0')->get();
|
|
|
+
|
|
|
+ for($i=0;$i<count($data);$i++){
|
|
|
+ //$data[$i]->id = $data[$i]->lg_id;
|
|
|
+
|
|
|
+ if($data[$i]->status == '-1'){
|
|
|
+ $data[$i]->league_status = '未启用';
|
|
|
+ }
|
|
|
+ if($data[$i]->status == '1'){
|
|
|
+ $data[$i]->league_status = '启用';
|
|
|
+ }
|
|
|
+
|
|
|
+ $str = 0;
|
|
|
+ $str1 = 0;
|
|
|
+ if($data[$i]->area_id == '0'){
|
|
|
+ $data[$i]->area = '无';
|
|
|
+ }else{
|
|
|
+ for($b=0;$b<count($area);$b++){
|
|
|
+ if($area[$b]->id == $data[$i]->area_id){
|
|
|
+ $str = 1;
|
|
|
+ $data[$i]->area = $area[$b]->name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($str == 0){$data[$i]->area = '无';}
|
|
|
+ }
|
|
|
+ if($data[$i]->country_id == 0){
|
|
|
+ $data[$i]->country = '无';
|
|
|
+ }else{
|
|
|
+ for($c=0;$c<count($country);$c++){
|
|
|
+ if($country[$c]->id == $data[$i]->country_id){
|
|
|
+ $str1 = 1;
|
|
|
+ $data[$i]->country = $country[$c]->name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($str1 == 0){$data[$i]->country = '无';}
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return $data->toArray();
|
|
|
+ }
|
|
|
}
|