'ZqRule', 'lq' => 'LqRule', 'wq' => 'WqRule', 'bq' => 'BqRule', ]; public function getNoticeDate($id) { $noticeMode = DB::table('comendnotice')->where(['id' => $id])->first(); if (empty($noticeMode)) { throw new \Exception("没有找到notice记录-" . $id); } return $noticeMode; } //得到比赛最终结果记录 public function getCompResult($type, $match_id) { $model = null; switch ($type) { case 'bq': $model = DB::table('st_bq_result')->where('match_id', $match_id)->orderby('id', 'asc')->get(); break; case 'lq': $model = DB::table('st_lq_result')->where('match_id', $match_id)->orderby('id', 'asc')->get(); break; case 'wq': $model = DB::table('st_wq_result')->where('match_id', $match_id)->orderby('id', 'asc')->get(); break; case 'zq': $model = DB::table('st_zq_result')->where('match_id', $match_id)->orderby('id', 'asc')->get(); break; } if (empty($model)) { throw new \Exception("没有找到赛事结果记录-" . $type . '-' . $match_id); } return $model; } //单式订单存在 单独设置比赛结果的情况,要分开处理 public function getSimplexData($type, $match_id) { $return = []; $ret = DB::table("money_buy_simplex")->where(['game_code' => $type, 'match_id' => $match_id])->get(); if (count($ret) <= 0) { return; } foreach ($ret as $val) { $return[$val->batch_id][$val->match_id] = ['result_flag' => $val->result_flag, 'single_result' => $val->single_result]; } return $return; } //找到订单详细数据 public function getMatchRecords($type, $match_id, $bet_type) { $return = []; $ret = DB::table("money_buy_match")->where(['game_code' => $type, 'match_id' => $match_id, 'bet_type' => $bet_type])->get(); if (count($ret) <= 0) { return; } foreach ($ret as $val) { $return[] = $val; } return $return; } public function getAdapterObj($game_type) { $game_type = strtolower($game_type); if (!isset($this->gameAllMap)) { throw new \Exception('赛事类型错误-' . $game_type, 4002); return false; } switch ($game_type) { case 'bq': $apd = new BqRule(); break; case 'lq': $apd = new LqRule(); break; case 'wq': $apd = new WqRule(); break; case 'zq': $apd = new ZqRule(); break; } return $apd; } //冠军比赛结果 public function getGjDatas($matchModel) { $table = 'st_' . $matchModel->game_code . '_league_result'; $where = ['lg_id' => $matchModel->lg_id, 'game_name' => $matchModel->odds_code]; $model = DB::table($table)->where($where)->first(); if (count($model) <= 0) { throw new \Exception('冠军数据没找到!'); } return $model; } }