function act_auditorNameVerify() { $auditorName = trim($_POST['whData']); $usermodel = UserModel::getInstance(); $whereStr = "where a.global_user_name = '" . $auditorName . "'"; $auditorUserId = $usermodel->getGlobalUserLists('global_user_id', $whereStr, '', ''); //$auditorUserId[0]['global_user_id']; if (empty($auditorUserId)) { self::$errCode = '4444'; return false; } else { self::$errCode = '200'; return $auditorUserId; } }
public function view_getWhAuditRecords() { $type = isset($_GET['type']) ? $_GET['type'] : ''; $status = isset($_GET['status']) ? $_GET['status'] : ''; $whAuditAct = new WhAuditAct(); $where = "WHERE 1=1 "; if ($type == 'search') { $ordersn = isset($_GET['ordersn']) ? post_check($_GET['ordersn']) : ''; $auditStatus = isset($_GET['auditStatus']) ? post_check($_GET['auditStatus']) : ''; $cStartTime = isset($_GET['cStartTime']) ? post_check($_GET['cStartTime']) : ''; $cEndTime = isset($_GET['cEndTime']) ? post_check($_GET['cEndTime']) : ''; if (!empty($ordersn)) { $where .= "AND ordersn='{$ordersn}' "; } if (intval($auditStatus) != 0) { $where .= "AND auditStatus='{$auditStatus}' "; } if (!empty($cStartTime)) { $startTime = strtotime($cStartTime . '00:00:00'); $where .= "AND auditTime >='{$startTime}' "; } if (!empty($cEndTime)) { $endTime = strtotime($cEndTime . '23:59:59'); $where .= "AND auditTime <='{$endTime}' "; } } $total = $whAuditAct->act_getTNameCount('wh_audit_records', $where); $num = 100; //每页显示的个数 $page = new Page($total, $num, '', 'CN'); $where .= "ORDER BY id DESC " . $page->limit; $whAuditRecords = $whAuditAct->act_getTNameList('wh_audit_records', '*', $where); for ($i = 0; $i < $total; $i++) { $whAuditList = $whAuditAct->act_getTNameList('wh_audit_relation_list', '*', "WHERE id='{$whAuditRecords[$i]['auditRelationId']}'"); $whAuditList0 = $whAuditList[0]; $whAuditRecords[$i]['nowAuditLevel'] = $whAuditList0['auditLevel']; //当前审核等级 $whAuditRecords[$i]['auditorId'] = $whAuditList0['auditorId']; //当前审核等级的审核人 //取得当前等级下对应的最大审核等级 $whAuditList = $whAuditAct->act_getTNameList('wh_audit_relation_list', 'auditLevel', "WHERE invoiceTypeId='{$whAuditList0['invoiceTypeId']}' AND storeId='{$whAuditList0['storeId']}' ORDER BY auditLevel DESC"); $whAuditList0 = $whAuditList[0]; $whAuditRecords[$i]['auditLevel'] = $whAuditList0['auditLevel']; //当前审核等级对应的最大审核等级 } if (!empty($_GET['page'])) { if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) { $n = 1; } else { $n = (intval($_GET['page']) - 1) * $num + 1; } } else { $n = 1; } if ($total > $num) { //输出分页显示 $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9)); } else { $show_page = $page->fpage(array(0, 2, 3)); } $navlist = array(array('url' => 'index.php?mod=whIoStore&act=getWhIoStoreList&ioType=1', 'title' => '单据业务'), array('url' => '', 'title' => '审核记录信息')); $usermodel = UserModel::getInstance(); //审核人 $count = count($whAuditRecords); for ($i = 0; $i < $count; $i++) { $user_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$whAuditRecords[$i]['auditorId']}'", '', 'limit 1'); $whAuditRecords[$i]['auditor'] = $user_info[0]['global_user_name']; } $this->smarty->assign('navlist', $navlist); $this->smarty->assign('toptitle', '审核记录信息'); $this->smarty->assign('toplevel', 3); $this->smarty->assign('secondlevel', '012'); $this->smarty->assign('show_page', $show_page); $this->smarty->assign('status', $status); $this->smarty->assign('whAuditRecords', $whAuditRecords); //循环列表 $this->smarty->display("whAuditRecords.htm"); }