function test_action_remove() { $mobile = "18601628932"; $stf_id = \Model_Admin_Staff::get_staff_id_by_mobile($mobile); if ($stf_id) { $res = $this->obj->action_remove($stf_id, "1"); var_export($res); } else { throw new Exception("stf_id is null"); } }
static function check_login($username, $password) { $res = false; if (Utils::is_mobile($username)) { $stf_id = Model_Admin_Staff::get_staff_id_by_mobile($username); if (!$stf_id) { _throw("员工不存在"); } self::_debug(array(__METHOD__, $stf_id)); $user = Model_Admin_Staff::get_auth_user_by_stf_id($stf_id); self::_debug(array("auth user", $stf_id, $user)); if (!$user) { _throw("员工未授权"); } $_password = $user['password']; $salt = $user['salt']; if ($_password !== self::gen_password($password, $salt)) { _throw("密码不正确"); } $res = true; } return $res; }