public function afterValidation(&$data) { $ex = DBWOGPlayerTeam::find($data['m_id']); if ($data['pkval'] && $ex && $data['pkval'] != $data['m_id']) { Response::alert("ID重複"); } foreach ([1, 2, 3, 4, 5] as $n) { if ($data["skill_{$n}"] > 0) { $s = DBWOGSkill::find($data["skill_{$n}"]); if (!$s) { Response::alert("技能{$n}(s_id={$data["skill_{$n}"]})不存在"); } } } if ($data['d_id']) { foreach (explode(',', $data['d_id']) as $d_id) { $d = DBWOGItem::find($d_id); if (!$d) { Response::alert("道具(d_id={$d_id})不存在"); } } } if ($data['m_mission'] > 0) { $m = DBWOGMission::find($data['m_mission']); if (!$m) { Response::alert("任務(m_id={$data['m_mission']})不存在"); } } }
public function afterValidation(&$data) { $ex = DBWOGPlayerTeam::find($data['i_id']); if ($data['pkval'] && $ex && $data['pkval'] != $data['i_id']) { Response::alert("ID重複"); } }
public function afterValidation(&$data) { $ex = DBWOGPlayerTeam::find($data['t_id']); if ($data['pkval'] && $ex && $data['pkval'] != $data['t_id']) { Response::alert("ID重複"); } $ex = DBWOGPlayer::find($data['p_id']); if (!$ex) { Response::alert("玩家(p_id={$data['p_id']})不存在"); } }