function _before_update(&$data, $options) { $old_data = M("Crm")->find($data['id']); $diff = array_diff_assoc($data, $old_data); $diff = array_keys($diff); $desc = array('name' => '姓名', 'mobile_tel' => '手机', 'district' => '小区', 'need' => '客户需求', 'source' => '客户来源', 'age' => '年龄', 'work' => '职业'); if (!empty($diff)) { foreach ($diff as $val) { $model->need = implode(",", $model->need); if (is_array($data[$val])) { $new = implode(",", $data[$val]); } else { $new = $data[$val]; } $comment .= $desc[$val] . ":" . $old_data[$val] . "->" . $new . " ; "; } $model = D("CrmLog"); $log['user_id'] = get_user_id(); $log['user_name'] = get_user_name(); $log['create_time'] = time(); $log['crm_id'] = $data['id']; $log['emp_no'] = get_emp_no(); $log['comment'] = $comment; $model->add($log); } }
function folder() { $widget['date'] = true; $this->assign("widget", $widget); $folder = $_REQUEST['fid']; $this->assign("folder", $folder); if (empty($folder)) { $this->error("系统错误"); } $emp_no = get_emp_no(); $user_id = get_user_id(); $map = $this->_search(); if (method_exists($this, '_search_filter')) { $this->_search_filter($map); } $model = D("ProductView"); $this->assign("auth", $this->config['auth']); $where = array(); $where['id'] = array('eq', $folder); $folder_name = M("SystemFolder")->where($where)->getField("name"); $this->assign("folder_name", $folder_name); $this->_list($model, $map); $this->_assign_folder_list(); $this->display(); }
public function index() { header("Content-Type:text/html; charset=utf-8"); $widget['jquery-ui'] = true; $this->assign("widget", $widget); $config = D("UserConfig")->get_config(); $this->assign("home_sort", $config['home_sort']); $flow_type = M("flow_type"); $data['tag'] = 88; $flowlist = $flow_type->where($data)->select(); $this->assign("flowlist", $flowlist); $flow = M("flow"); //追踪流程 $this->show = $flow->where('user_id ="' . (int) get_user_id() . '" AND (type=69 or type=70 or type=71 or type=72 or type=73)')->limit(50)->select(); //已审批 $this->show1 = $flow->where('user_id ="' . (int) get_user_id() . '" AND (type=69 or type=70 or type=71 or type=72 or type=73) AND step=40')->limit(50)->select(); //待审批的列表 $user_id = get_user_id(); $emp_no = get_emp_no(); $FlowLog = M("FlowLog"); $model = D('Flow'); $where['emp_no'] = $emp_no; $where['result'] = 3; $log_list = $FlowLog->where($where)->getField('flow_id id,flow_id'); // dump($where); $map['id'] = array('in', $log_list); $map['type'] = array('in', '69,70,71,72,73'); $todo_flow_list = $model->where($map)->limit(50)->order("create_time desc")->select(); $this->assign("todo_flow_list", $todo_flow_list); $this->display(); }
function _search_filter(&$map) { if ($this->config['auth']['admin'] == false) { $map['emp_no'] = array('eq', get_emp_no()); } if (!empty($_POST['keyword'])) { $map['B|C'] = array('like', "%" . $_POST['keyword'] . "%"); } }
function _search_filter(&$map) { if ($this->config['auth']['admin'] == false) { $map['emp_no'] = array('eq', get_emp_no()); } if (!empty($_POST['keyword'])) { //$map['B|C'] = array('like', "%" . $_POST['keyword'] . "%"); $keyword = $_POST['keyword']; $where['B'] = array('like', "%" . $keyword . "%"); $where['C'] = array('like', "%" . $keyword . "%"); $where['_logic'] = 'or'; $map['_complex'] = $where; } }
public function index() { $widget['jquery-ui'] = true; $this->assign("widget", $widget); $uid = get_user_id(); $deptid = get_dept_id(); $username = get_user_name(); // 通用流程 $this->flow = M('flow')->where('type = 96 and (user_id=' . $uid . ' or confirm like "%' . $deptid . '%" or confirm like "%' . $uid . '%")')->select(); //通用任务 $this->task = M('task')->where('type = "chengguo" and (user_id=' . $uid . ' or executor like "%' . $username . '%")')->select(); //申报加分 $this->shenbao = M('flow')->where('type = 44 and user_id=' . $uid)->select(); $config = D("UserConfig")->get_config(); $this->assign("home_sort", $config['home_sort']); $flow = M('flow')->select(); $emp_no = get_emp_no(); $uid = get_user_id(); //订教材 流程图 $flow = M('task')->where('name = "科研成果"')->select(); if (!empty($flow)) { //dump($flow); $this->isfa = 1; //第一步 $this->taskId = $flow[0]['id']; $taskFrom = $flow[0]['user_id']; //发起人id $taskId = $flow[0]['id']; //dump($taskId); $taskStatus = M('task_log')->where('task_id = "' . $taskId . '" and executor =' . $uid)->find(); dump($uid); if ($taskStatus['status'] == 4 or $taskFrom == $taskStatus['assigner']) { $this->iszhuan = 1; //第二步, 已转交 OR 发起人!=分配人 说明任务已被转交 } if ($taskStatus['status'] == 3) { $this->iszhuan = 1; //第二步 $this->iswan = 1; //第三步, 完成 } } $this->display(); }
protected function _flow_list() { $user_id = get_user_id(); $emp_no = get_emp_no(); $model = D('Flow'); //带审批的列表 $FlowLog = M("FlowLog"); $where['emp_no'] = $emp_no; $where['_string'] = "result is null"; $log_list = $FlowLog->where($where)->field('flow_id')->select(); $log_list = rotate($log_list); if (!empty($log_list)) { $map['id'] = array('in', $log_list['flow_id']); $todo_flow_list = $model->where($map)->field("id,name,create_time")->limit(6)->order("create_time desc")->select(); $this->assign("todo_flow_list", $todo_flow_list); } //已提交 $map = array(); $map['user_id'] = $user_id; $map['step'] = array('gt', 10); $submit_process_list = $model->where($map)->field("id,name,create_time")->limit(6)->order("create_time desc")->select(); $this->assign("submit_flow_list", $submit_process_list); }
function edit() { $widget['date'] = true; $widget['uploader'] = true; $widget['editor'] = true; $this->assign("widget", $widget); $folder = $_REQUEST['fid']; $this->assign("folder", $folder); if (empty($folder)) { $this->error("系统错误"); } $this->_flow_auth_filter($folder, $map); $model = D("Flow"); $id = $_REQUEST['id']; $where['id'] = array('eq', $id); $where['_logic'] = 'and'; $map['_complex'] = $where; $vo = $model->where($map)->find(); if (empty($vo)) { $this->error("系统错误"); } $this->assign('vo', $vo); $model_flow_field = D("FlowField"); $field_list = $model_flow_field->get_data_list($id); $this->assign("field_list", $field_list); $model = M("FlowType"); $type = $vo['type']; $flow_type = $model->find($type); $this->assign("flow_type", $flow_type); $model = M("FlowLog"); $where['flow_id'] = $id; $where['_string'] = "result is not null"; $flow_log = $model->where($where)->select(); $this->assign("flow_log", $flow_log); $where = array(); $where['flow_id'] = $id; $where['emp_no'] = get_emp_no(); $where['_string'] = "result is null"; $confirm = $model->where($where)->select(); $this->assign("confirm", $confirm[0]); $this->display(); }
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; }
function is_last_consult($flow_id) { $consult = M("Flow")->where("id={$flow_id}")->getField("consult"); if (empty($consult)) { return true; } $last_consult = array_filter(explode("|", $consult)); $last_consult_emp_no = end($last_consult); if (strpos($last_consult_emp_no, get_emp_no()) !== false) { return true; } return false; }
private function _receive_file($str, &$model) { if (!empty($str)) { $ar = array_filter(explode(",", $str)); foreach ($ar as $key => $value) { $ar2 = explode("_", $value); $cid = $ar2[0]; if (true) { //if(strlen($cid)>10){ $inline = $ar2[1]; $file_name = $ar2[2]; $File = M("File"); $File->name = $file_name; $File->user_id = $model->user_id; $File->size = filesize($this->tmpPath . urlencode($value)); $File->extension = getExt($value); $File->create_time = time(); $sid = get_sid(); $File->sid = $sid; $File->module = MODULE_NAME; $dir = 'mail/' . get_emp_no() . "/" . date("Ym"); $File->savename = $dir . '/' . uniqid() . '.' . $File->extension; $save_name = $File->savename; if (!is_dir(get_save_path() . $dir)) { mkdir(get_save_path() . $dir, 0777, true); chmod(get_save_path() . $dir, 0777); } if (!is_dir($this->tmpPath . $dir)) { mkdir($this->tmpPath . $dir, 0777, true); chmod($this->tmpPath . $dir, 0777); } if (rename($this->tmpPath . urlencode($value), get_save_path() . $save_name)) { $file_id = $File->add(); if ($inline == "INLINE") { $model->content = str_replace("cid:" . $cid, "/" . get_save_path() . $save_name, $model->content); } else { $add_file = $add_file . $sid . ';'; } } } } return $add_file; } }
public function reject() { $model = D("CrmLog"); if (false === $model->create()) { $this->error($model->getError()); } $crm_id = $model->crm_id; $model->emp_no = get_emp_no(); //保存当前数据对象 $list = $model->add(); if ($list !== false) { //保存成功 M("Crm")->where("id={$crm_id}")->setField('status', 2); $this->assign('jumpUrl', U('crm/review')); $this->success('操作成功!'); } else { //失败提示 $this->error('操作失败!'); } }
function edit() { $widget['uploader'] = true; $widget['editor'] = true; $this->assign("widget", $widget); $info = M("FlowDocSys")->where("id=1")->find(); $config = $info; if (preg_match("/\\{.*?\\}/is", $info['doc_type'])) { $config['doc_type'] = json_decode($info['doc_type'], true); } if (preg_match("/{.*?\\}/is", $info['doc_level'])) { $config['doc_level'] = json_decode($info['doc_level'], true); } if (preg_match("/\\{.*?\\}/is", $info['doc_acute'])) { $config['doc_acute'] = json_decode($info['doc_acute'], true); } $model = D("Flow"); $id = $_REQUEST['id']; $vo = $model->getById($id); $this->assign('vo', $vo); $this->assign("config", $config); if (in_array('add_file', $model->getDbFields())) { $this->_assign_file_list($vo["add_file"]); } $model = M("FlowType"); $type = $vo['type']; $flow_type = $model->find($type); $this->assign("flow_type", $flow_type); $model = M("FlowLog"); $where['flow_id'] = $id; $where['_string'] = "result is not null"; $flow_log = $model->where($where)->select(); $this->assign("flow_log", $flow_log); trace($flow_log); $where = array(); $where['flow_id'] = $id; $where['emp_no'] = get_emp_no(); $where['_string'] = "result is null"; $confirm = $model->where($where)->select(); $this->assign("confirm", $confirm[0]); $this->display(); }
public function index() { cookie("current_node", 354); // cookie("top_menu", 255); // cookie("top_menu2", 255); if (!empty($_GET['id'])) { $uid = $_GET['id']; } else { $uid = get_user_id(); } $this->userlist = M('user')->find($uid); $emp_no = $this->userlist['emp_no']; $userName = $this->userlist['name']; $position_id = $this->userlist['position_id']; if ($position_id == 16) { $where['user'] = "******"; } else { $where['user'] = $userName; } if ($position_id == 14) { $where['_string'] = "id >38 and step1_position = " . $position_id; $where['_logic'] = 'OR'; } $this->leftMenu = M('task_type')->where($where)->select(); $sy = "SELECT *FROM onethink_document_syllabus GROUP BY course "; $member = M()->query($sy); $this->assign('member', $member); $teacher = M('user')->select(); $this->assign('teacher', $teacher); $task = M('task'); $taskgt = $task->where(' executor like "%' . get_user_name() . '%"')->order('id desc')->select(); $this->assign('taskgt', $taskgt); $widget['jquery-ui'] = true; $this->assign("widget", $widget); //dump($uid); //die(); $config = D("UserConfig")->get_config(); $this->assign("home_sort", $config['home_sort']); $flow = M('flow'); $flow_log = M('flow_log'); $this->data01 = $flow->where('user_id ="' . $uid . '" and (type=38)')->limit(1)->select(); $this->data02 = $flow->where('user_id ="' . $uid . '" and (type=50)')->limit(1)->select(); $this->data03 = $flow->where('user_id ="' . $uid . '" and (type=53)')->limit(1)->select(); $this->data04 = $flow->where('user_id ="' . $uid . '" and (type=55)')->limit(1)->select(); $this->data05 = $flow->where('user_id ="' . $uid . '" and type=68')->limit(1)->select(); // and jiaoan ="" $this->data06 = $flow->where('user_id ="' . $uid . '" and (type=77)')->limit(1)->select(); $this->data11 = $flow->where('user_id ="' . $uid . '" and (type=79)')->limit(1)->select(); $this->data12 = $flow->where('user_id ="' . $uid . '" and (type=80)')->limit(1)->select(); $this->data13 = $flow->where('user_id ="' . $uid . '" and (type=81)')->limit(1)->select(); $this->data14 = $flow->where('user_id ="' . $uid . '" and (type=82)')->limit(1)->select(); $this->data15 = $flow->where('user_id ="' . $uid . '" and (type=85)')->limit(1)->select(); $this->data16 = $flow->where('user_id ="' . $uid . '" and (type=89)')->limit(1)->select(); $this->yichang = M('schedule')->where('user_id ="' . $uid . '" and priority = 5')->limit(6)->select(); //待办任务 $task = M('task'); $wherelog['executor'] = $uid; $wherelog['status'] = array('in', '0,1'); $task_ids = M('task_log')->where($wherelog)->getField("task_id id,task_id"); $where['id'] = array('in', $task_ids); $this->fabu = $task->where($where)->order('id desc')->limit(50)->select(); //完成任务 $where_log['executor|assigner|transactor'] = $uid; $where_log['status'] = array("in", "3,4"); $task_ids2 = M('task_log')->where($where_log)->getField("task_id id,task_id"); $where2['id'] = array('in', $task_ids2); $this->jieshou = $task->where($where2)->order('id desc')->limit(50)->select(); //待审批的列表 $model = D('Flow'); $FlowLog = M("FlowLog"); $model = D('Flow'); $where['result'] = 3; $where['emp_no'] = $emp_no; $log_list = $FlowLog->where($where)->getField('flow_id id,flow_id'); $map['id'] = array('in', $log_list); $todo_flow_list = $model->where($map)->limit(6)->order("create_time desc")->select(); $this->assign("faqi", $todo_flow_list); $this->shenpi = $flow->where('(confirm like "%' . get_emp_no() . '%" or user_id ="' . $uid . '") AND step=40 ')->order('id desc')->limit('50')->select(); //dump($jieshou); //die(); $this->display(); }
function get_new_count() { $emp_no = get_emp_no(); //获取未读邮件 $data = array(); $user_id = get_user_id(); $where['user_id'] = $user_id; $where['is_del'] = array('eq', '0'); $where['folder'] = array('eq', 1); $where['read'] = array('eq', '0'); $new_mail_inbox = M("Mail")->where($where)->count(); $data['bc-mail']['bc-mail-inbox'] = $new_mail_inbox; //获取未读邮件 $where['user_id'] = $user_id; $where['is_del'] = array('eq', '0'); $where['folder'] = array('gt', 6); $where['read'] = array('eq', '0'); $new_mail_myfolder = M("Mail")->where($where)->count(); $data['bc-mail']['bc-mail-myfolder'] = $new_mail_myfolder; //获取待裁决 $where = array(); $FlowLog = M("FlowLog"); $where['emp_no'] = $emp_no; $where['_string'] = "result is null"; $log_list = $FlowLog->where($where)->field('flow_id')->select(); $log_list = rotate($log_list); $new_confirm_count = 0; if (!empty($log_list)) { $map['id'] = array('in', $log_list['flow_id']); $new_confirm_count = M("Flow")->where($map)->count(); } $data['bc-flow']['bc-flow-confirm'] = $new_confirm_count; //获取收到的流程 $where = array(); $where['emp_no'] = $emp_no; $where['step'] = 100; $where['is_read'] = 1; $log_list = M("FlowLog")->where($where)->field('flow_id')->select(); $log_list = rotate($log_list); $new_receive_count = 0; if (!empty($log_list)) { $map['id'] = array('in', $log_list['flow_id']); $new_receive_count = M("Flow")->where($map)->count(); } $data['bc-flow']['bc-flow-receive'] = $new_receive_count; //获取最新通知 $where = array(); $where['is_del'] = array('eq', '0'); $folder_list = D("SystemFolder")->get_authed_folder(get_user_id(), "NoticeFolder"); $where['folder'] = array('in', $folder_list); $where['create_time'] = array("egt", time() - 3600 * 24 * 30); $readed = array_filter(explode(",", get_user_config("readed_notice"))); $where['id'] = array("not in", $readed); $new_notice_count = M('Notice')->where($where)->count(); $data['bc-notice']['bc-notice-new'] = $new_notice_count; //获取待办事项 $where = array(); $where['user_id'] = $user_id; $where['status'] = array("in", "1,2"); $new_todo_count = M("Todo")->where($where)->count(); $data['bc-personal']['bc-personal-todo'] = $new_todo_count; //获取日程事项 $where = array(); $where['user_id'] = $user_id; $where['start_date'] = array("elt", date("Y-m-d")); $where['end_date'] = array("egt", date("Y-m-d")); $new_schedule_count = M("Schedule")->where($where)->count(); $data['bc-personal']['bc-personal-schedule'] = $new_schedule_count; //获取最新消息 $model = M("Message"); $where = array(); $where['owner_id'] = $user_id; $where['receiver_id'] = $user_id; $where['is_read'] = array('eq', '0'); $new_message_count = M("Message")->where($where)->count(); $data['bc-message']['bc-message-new'] = $new_message_count; //等我接受的任务 $where = array(); $where_log['type'] = 1; $where_log['status'] = 0; $where_log['executor'] = get_user_id(); $task_list = M("TaskLog")->where($where_log)->getField('task_id id,task_id'); $where['id'] = array('in', $task_list); $task_todo_count = M("Task")->where($where)->count(); $data['bc-task']['task_todo_count'] = $task_todo_count; //我部门任务 $where = array(); $auth = D("Role")->get_auth("Task"); if ($auth['admin']) { $where_log['type'] = 2; $where_log['executor'] = get_dept_id(); $task_list = M("TaskLog")->where($where_log)->getField('task_id id,task_id'); $where['id'] = array('in', $task_list); } else { $where['_string'] = '1=2'; } $task_dept_count = M("Task")->where($where)->count(); $data['bc-task']['task_dept_count'] = $task_dept_count; return $data; }
/** * 公文浏览接口 * @param int $id 公文ID; * @return string $confirm 审核人 * @return string $consult 签发人 * @return string $refer 收件人 */ public function flowRead() { $model = D("Flow"); $id = $_REQUEST['id']; $vo = $model->getById($id); $vo['confirm'] = explode('|', $vo['confirm']); $vo['consult'] = explode('|', $vo['consult']); $vo['refer'] = explode('|', $vo['refer']); array_pop($vo['confirm']); array_pop($vo['consult']); array_pop($vo['refer']); $vo['confirm_name'] = self::arr_getName($vo['confirm']); $vo['consult_name'] = self::arr_getName($vo['consult']); $vo['refer_name'] = self::arr_getName($vo['refer']); if (in_array('add_file', $model->getDbFields())) { $files = array_filter(explode(';', $vo['add_file'])); $where['sid'] = array('in', $files); $where['module'] = 'Flow'; $model = M("File"); $list = $model->where($where)->select(); if ($list) { for ($i = 0; $i < count($list); $i++) { $list[$i]['username'] = D('user')->where('id=' . $list[$i]['user_id'])->getField('emp_name'); } } $vo['add_file'] = $list; } $model = M("FlowLog"); $where['flow_id'] = $id; $where['_string'] = "result is not null"; $flow_log = $model->where($where)->order('step')->select(); $vo['flow_log'] = $flow_log ? $flow_log : ''; $where = array(); $where['flow_id'] = $id; $where['emp_no'] = get_emp_no(); $where['_string'] = "result is null"; $to_confirm = $model->where($where)->field('result,user_id', true)->find(); $vo['to_confirm'] = $to_confirm ? $to_confirm : ''; // var_dump($vo); // exit; if ($vo) { $this->result('1', '', $vo); } else { $this->result('0', '无数据!'); } }
public function jiaoxuezongjie() { $emp_no = get_emp_no(); $flow = M('flow')->select(); $emp_no = get_emp_no(); $uid = get_user_id(); $this->position_id = get_position_id(); $this->user_rank = get_user_rank(); $task = M('task')->where('type = "9" ')->order('id desc')->select(); if (!empty($task)) { //dump($flow); $this->isfa = 1; //第一步 $this->taskId = $task[0]['id']; $taskId = $task[0]['id']; $this->lc = task_step_status($this->taskId, 1); $this->zr = task_step_status($this->taskId, 2); $this->js = task_step_status($this->taskId, 3); } //订教材 颜色判断 if ($this->isfa) { $this->btn1 = "btn-success"; //第二步开始 if ($this->lc) { $this->btn2 = "btn-success"; //第三步开始 if ($this->zr) { $this->btn3 = "btn-success"; //第四步开始 if ($this->js) { $this->btn4 = "btn-success"; } else { $this->btn4 = "btn-danger"; } //第四步结束 } else { $this->btn3 = "btn-danger"; } //第三步结束 } else { $this->btn2 = "btn-danger"; } //第二步开始 } else { $this->btn1 = "btn-danger"; } // 综合类 总结 $task = M('task')->where('type = "2092" ')->order('id desc')->select(); if (!empty($task)) { //dump($flow); $this->isfa202 = 1; //第一步 $this->taskId202 = $task[0]['id']; $taskId202 = $task[0]['id']; $this->lc202 = task_step_status($this->taskId202, 1); $this->zr202 = task_step_status($this->taskId202, 2); $this->js202 = task_step_status($this->taskId202, 3); } //订教材 颜色判断 if ($this->isfa202) { $this->btn2201 = "btn-success"; //第二步开始 if ($this->lc202) { $this->btn2202 = "btn-success"; //第三步开始 if ($this->zr202) { $this->btn2203 = "btn-success"; //第四步开始 if ($this->js202) { $this->btn2204 = "btn-success"; } else { $this->btn2204 = "btn-danger"; } //第四步结束 } else { $this->btn2203 = "btn-danger"; } //第三步结束 } else { $this->btn2202 = "btn-danger"; } //第二步开始 } else { $this->btn2201 = "btn-danger"; } // 教学总结 $task_type = "9,2092"; //任务类型 $flow_type = "77"; //流程类型 $this->todo = task_todo($task_type) . flow_todo($flow_type); // 未完成 $this->doing = task_ing($task_type) . flow_ing($flow_type); // 等待中 $this->done = task_done($task_type) . flow_done($flow_type); // 已完成 // 专业 $task = M('task')->where('type = "209" ')->order('id desc')->select(); if (!empty($task)) { //dump($flow); $this->isfa20 = 1; //第一步 $this->taskId20 = $task[0]['id']; $taskId20 = $task[0]['id']; $this->lc20 = task_step_status($this->taskId20, 1); $this->zr20 = task_step_status($this->taskId20, 2); $this->js20 = task_step_status($this->taskId20, 3); } //订教材 颜色判断 if ($this->isfa20) { $this->btn201 = "btn-success"; //第二步开始 if ($this->lc20) { $this->btn202 = "btn-success"; //第三步开始 if ($this->zr20) { $this->btn203 = "btn-success"; //第四步开始 if ($this->js20) { $this->btn204 = "btn-success"; } else { $this->btn204 = "btn-danger"; } //第四步结束 } else { $this->btn203 = "btn-danger"; } //第三步结束 } else { $this->btn202 = "btn-danger"; } //第二步开始 } else { $this->btn201 = "btn-danger"; } // 教学总结 $task_type20 = "209"; //任务类型 $flow_type20 = "89"; //流程类型 $this->todo20 = task_todo($task_type20) . flow_todo($flow_type20); // 未完成 $this->doing20 = task_ing($task_type20) . flow_ing($flow_type20); // 等待中 $this->done20 = task_done($task_type20) . flow_done($flow_type20); // 已完成 $this->display(); }
private function _check_auth($auth_list) { $arrtmp = array_filter(explode(';', $auth_list)); foreach ($arrtmp as $item) { if (stripos($item, "dept_") !== false) { $arr_dept = explode('|', $item); $dept_id = substr($arr_dept[1], 5); $emp_list = $this->get_emp_list_by_dept_id($dept_id); $emp_list = rotate($emp_list); $emp_list = $emp_list['emp_no']; //dump($emp_list); if (in_array(get_emp_no(), $emp_list)) { return true; } } else { if (stripos($item, get_emp_no()) !== false) { return true; } } } return false; }
top: 10%; right: -10px; }"> <span class="badge badge-pink"> <?php echo getToDoNum(); ?> </span> </a> </div> <div class="title_div"> <div class="logo" style="background: none!important;"> <table class="table table-bordered table-condensed" style="color:#fff"> <tr> <td>编号</td> <td><?php echo get_emp_no(); ?> </td> </tr> <tr> <td>职务</th> <td><?php echo get_rank_name(); ?> </td> </tr> <tr> <td>电话 </td> <td> <?php echo get_user_tel(); ?>
function getToDoNum() { $task = M('task'); $wherelog['executor'] = get_user_id(); $wherelog['status'] = array('in', '0,1'); $task_ids = M('task_log')->where($wherelog)->getField("task_id id,task_id"); $where['id'] = array('in', $task_ids); $count1 = $task->where($where)->count(); $model = D('Flow'); $user_id = get_user_id(); $emp_no = get_emp_no(); $FlowLog = M("FlowLog"); $where['emp_no'] = $emp_no; $where['_string'] = "result is null"; $log_list = $FlowLog->where($where)->field('flow_id')->select(); $log_list = rotate($log_list); $map['id'] = array('in', $log_list['flow_id']); $count2 = $model->where($map)->field("id,name,create_time")->limit(6)->count(); //$count2=$flow->where('confirm like "%'.get_emp_no().'%" AND step != 40')->count(); $result = $count1 + $count2; return $result; }