diff --git a/webapp/controller/TeamController.class.php b/webapp/controller/TeamController.class.php index f9df2267..e1a805c2 100644 --- a/webapp/controller/TeamController.class.php +++ b/webapp/controller/TeamController.class.php @@ -1,10 +1,13 @@ _rspErr(1, 'pve_instance_id error'); + $this->_rspErr(1, "You can't challenge beyond your level"); + return; + } + $temp = array(); + Hero::getHeroList(function ($row) use ($pveGame,&$temp) { + if ($row['quality']>=$pveGame['gemini_lv']){ + array_push($temp,$row); + } + }); + if (count($temp)<1){ + $this->_rspErr(1, 'Lack of qualified heroes'); return; } } @@ -110,6 +123,17 @@ class TeamController extends BaseAuthedController { $this->_rspErr(1, 'No challenge'); return; } + $pveGame = \mt\PveGemini::get($teamDb['pve_instance_id']); + $temp = array(); + Hero::getHeroList(function ($row) use ($pveGame,&$temp) { + if ($row['quality']>=$pveGame['gemini_lv']){ + array_push($temp,$row); + } + }); + if (count($temp)<1){ + $this->_rspErr(1, 'Lack of qualified heroes'); + return; + } } $userDto = User::info($userDb);