本文整理汇总了PHP中Model_User::createCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_User::createCache方法的具体用法?PHP Model_User::createCache怎么用?PHP Model_User::createCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_User
的用法示例。
在下文中一共展示了Model_User::createCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($postArr)
{
if (empty($postArr['Id'])) {
return array('msg' => '参数错误', 'status' => -1, 'href' => 2);
}
if (empty($postArr['name'])) {
return array('msg' => '项目名称不能为空', 'status' => -1, 'href' => 2);
}
if (empty($postArr['principal_user_id'])) {
return array('msg' => '请选择项目负责人', 'status' => -1, 'href' => 2);
}
if (empty($postArr['detail'])) {
$postArr['detail'] = '暂无内容';
}
$updateArr = array('name' => $postArr['name'], 'principal_user_id' => $postArr['principal_user_id'], 'detail' => $postArr['detail']);
$this->update($updateArr, "Id={$postArr['Id']}");
$this->_modelUser = $this->_getGlobalData('Model_User', 'object');
$this->_modelUser->execute("update {$this->_modelUser->tName()} set project_id=0 where project_id = {$postArr['Id']}");
if (count($postArr['user_id'])) {
$this->_modelUser->execute("update {$this->_modelUser->tName()} set project_id={$postArr['Id']} where Id in (" . implode(',', $postArr['user_id']) . ")");
}
$this->_modelUser->createCache();
$this->createCache();
return array('msg' => '项目修改成功', 'status' => 1, 'href' => Tools::url('ProgramProject', 'Index', array('zp' => 'Program')));
}
示例2: _departmentDel
/**
* 删除部门
*/
private function _departmentDel()
{
if ($this->_modelDepartment->delById($_GET['Id'])) {
$this->_modelUser->update(array('department_id' => '0'), "department_id={$_GET['Id']}");
//将这个部门的所有员工都更新为0,无部门
$this->_modelDepartment->createCache();
$this->_modelUser->createCache();
$this->_utilMsg->showMsg('删除部门成功');
} else {
$this->_utilMsg->showMsg('删除部门失败', -2);
}
}
示例3: createUser
/**
* 创建用户
* @param array $userInfo 用户信息
* @return boolean
*/
public function createUser($userInfo)
{
$this->_modelUser = $this->_getGlobalData('Model_User', 'object');
$this->_modelUser->add($userInfo);
$userInfo['Id'] = $this->_modelUser->returnLastInsertId();
$userClass = new Object_UserInfo();
$userClass->registerUserInfo($userInfo);
$userClass->setUpdateInfo(1);
$userClass = null;
$this->_modelUser->createCache();
return true;
}
示例4: cCreateCache
public function cCreateCache()
{
$this->_modelUser = $this->getGlobal('model/User', 'Model_User');
$this->_modelUser->createCache();
$this->success('创建缓存成功', url('setup/user/index'));
}