| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace App\Sports\Model;
- use \System\Model;
- /**
- * Class Account
- * @package App\Sports\Model
- * 用户账号
- */
- class St_wq_odds extends Model
- {
- protected $table = 'st_wq_odds';
- /**
- * @param array $where 条件
- * @param string $select 字段
- * @param string $sort 排序字段
- * @param string $orderby 排序方式
- * @return mixed
- * 获取赔率数据
- */
- public static function getOddsData($where=[],$select='id',$sort='id',$orderby='asc'){
- $oddsData = self::select($select)->where($where)->groupby("match_id","type")->get();
- return $oddsData;
- }
- //获取网球赛事下 默认赔率数据
- public static function getMatchOdds($source,$match_ids=[]){
- $oddsData = self::select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
- ->where($source)
- ->whereIn('match_id',$match_ids)
- ->where(
- function($query){
- $query->where('odds_code','dishes_home')
- ->orWhere(function($query){
- $query->where('odds_code','dishes_guest');
- })
- ->orWhere(function($query){
- $query->where('odds_code','kemp_home');
- })
- ->orWhere(function($query){
- $query->where('odds_code','kemp_guest');
- });
- }
- )
- ->get()
- ->toArray();
- return $oddsData;
- }
- }
|