protected function extend_process($param, $value) { if ($param == 'id') { return notice_readed($value['id']); } }
public function read() { $id = $_REQUEST['id']; notice_readed($id, false); $user_id = get_user_id(); $model = M("Notice"); $folder_id = $model->where("id={$id}")->getField('folder'); $this->assign("auth", $auth = D("SystemFolder")->get_folder_auth($folder_id)); $this->_edit(); }
function get_new_count() { $data = array(); //获取待裁决 $where = array(); $FlowLog = M("WorkflowLog"); $emp_no = get_emp_no(); $where['emp_no'] = $emp_no; $where['_string'] = "result is null"; $data['new_workflow_count'] = $FlowLog->where($where)->count(); // 会议未读 $user_id = get_user_id(); $where = array(); $where['user_id'] = $user_id; $where['is_del'] = array('eq', '0'); $where['finish'] = array('elt', '0'); $model = M("Meeting"); $meeting_count = $model->where($where)->count(); // dump($meeting_count);die; $data['new_meeting_count'] = $meeting_count; // dump($data); //获取未读邮件 $user_id = get_user_id(); $where = array(); $where['user_id'] = $user_id; $where['is_del'] = array('eq', '0'); $where['folder'] = array(array('eq', 1), array('gt', 6), 'or'); $where['read'] = array('eq', '0'); $model = M("Mail"); $new_mail_count = $model->where($where)->count(); $data['new_mail_count'] = $new_mail_count; $data['new_mail_class'] = $new_mail_count == 0 ? '' : 'icon-animated-vertical'; //获取待裁决 $where = array(); $FlowLog = M("FlowLog"); $emp_no = get_emp_no(); $where['emp_no'] = $emp_no; $where['_string'] = "result is null"; $data['new_documentFlow_count'] = $FlowLog->where($where)->count(); $data['new_documentFlow_class'] = $data['new_confirm_count'] == 0 ? '' : 'icon-animated-vertical'; //获取最新通知,一个月以内未被阅读过的公告 $model = D('Notice'); $where = array(); $where['is_del'] = array('eq', '0'); $folder_list = D("SystemFolder")->get_authed_folder(get_user_id(), "NoticeFolder"); $new_notice_count = 0; if ($folder_list) { $where['folder'] = array("in", $folder_list); $where['create_time'] = array('egt', time() - 3600 * 24 * 30); $new_notice_list = $model->where($where)->field('id')->select(); $readed = get_user_config("readed_notice"); if ($new_notice_list) { foreach ($new_notice_list as $key => $val) { if (!notice_readed($val['id'])) { $new_notice_count++; } } } } $data['new_notice_count'] = $new_notice_count; $data['new_notice_class'] = $new_notice_count == 0 ? '' : 'icon-animated-bell'; //获取待办事项 $model = M("Todo"); $where = array(); $where['user_id'] = $user_id; $where['status'] = array("in", "1,2"); $new_todo_count = M("Todo")->where($where)->count(); $data['new_todo_count'] = $new_todo_count; //获取最新消息 $model = M("Message"); $where = array(); $where['user_id'] = $user_id; $where['receiver_id'] = $user_id; $where['is_read'] = array('eq', '0'); $new_message_count = M("Message")->where($where)->count(); $data['new_message_count'] = $new_message_count; return $data; }