本文整理匯總了PHP中Model_Users::findOneUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model_Users::findOneUser方法的具體用法?PHP Model_Users::findOneUser怎麽用?PHP Model_Users::findOneUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Model_Users
的用法示例。
在下文中一共展示了Model_Users::findOneUser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addAction
public function addAction()
{
$user = new Model_Users();
$listlecturer = $user->findLecturer();
$this->view->listlecturer = $listlecturer;
$listRole = $user->findRole();
$this->view->listRole = $listRole;
if ($this->_request->isPost()) {
$data = $this->_getParam('searchParam');
$lecturer_id = $data['lecturer_id'];
if (!empty($data['username']) && !empty($data['role_id'])) {
$compareUser = $user->findOneUser($lecturer_id);
if (empty($compareUser) == false) {
echo '<script type="text/javascript">alert("Tài khoản ' . $lecturer_id . ' đã tồn tại")</script>';
unset($data);
} elseif (empty($compareUser) == true) {
$user->addUser($data);
$existUser = $user->findOneUser($lecturer_id);
$user_id = $existUser->user_id;
$user->addUserRole($user_id, $data['role_id']);
$this->redirect('giaovu/user/list');
}
} else {
echo "<span style='color:red;'>Mời bạn nhập đầy đủ thông tin</span>";
}
}
}
示例2: accountAction
public function accountAction()
{
$lecturer_id = $this->sessionGlobal->lecturer_id;
$user = new Model_Users();
$findUser = $user->findOneUser($lecturer_id);
$this->view->findUser = $findUser;
if ($this->_request->isPost()) {
$data = $this->_getParam('searchParam');
$user->updateUser($data);
echo "Thành công";
header("Refresh:0");
}
}