public function forgot() { $email = $this->request->post('email'); $type = $this->request->post('type'); if (empty($email) || empty($type)) { return false; } switch ($type) { case 'email': if (!is::email($email)) { return false; } $sql = 'SELECT id,code FROM UserLogin WHERE email=:id'; break; case 'phone': if (!is::phone($email)) { return false; } $sql = 'SELECT id,code FROM UserLogin WHERE phone=:id'; break; default: return false; } }