where(['game_code'=>$game_code])->whereIn('odds_code',$p_code)->select('id')->get()->toArray(); $p_ids = array_column($p_id_arr,'id'); $oddsCode = $this->whereIn('p_id',$p_ids)->select('odds_code','odds_name')->get()->toArray(); return $oddsCode; } }