/** * @申请状态列表 * @Author: 段涛 * @function name ApplicationStatus * @param string $action * @return string */ private function ApplicationStatus($action) { $array = array('' => 'All', '11' => appStatus(11), '12' => appStatus(12), '13' => appStatus(13), '14' => appStatus(14), '15' => appStatus(15), '16' => appStatus(16), '21' => appStatus(21), '22' => appStatus(22), '23' => appStatus(23), '24' => appStatus(24), '25' => appStatus(25), '30' => appStatus(31)); if ($action != '') { return array_search($action, $array); } else { return $array; } }
/** * 按待处理的学生列表 */ public function pendStudent() { $get = I('get.'); //输出可选择的年份 $allowApplyYears = $this->fetchAppliedYearsData(); $showYearList = $allowApplyYears['lists']; // 可选择的年份列表 $this->assign('showYearList', $showYearList); //获取中介列表 if (I('get.userType') == '中介') { $agentList = M('user_agent')->field('uid,name')->where(array('level' => 1))->order('id DESC')->select(); } $this->assign('agentList', $agentList); $agentName = M('user_agent')->where(array('level' => 1, 'uid' => I('get.agentNameID')))->order('id DESC')->getField('name'); //获取当前中介的名称 $this->assign('agentName', $agentName); $where = ' a.fuid IS NOT NULL'; //初始查询条件 //获取一级中介,和一级中介下面所有中介 if (I('get.agentNameID') != '') { $allAgent = M('user_agent')->field('uid')->where(array('level' => 2, 'fid' => I('get.agentNameID')))->order('id ASC')->select(); $fid = I('get.agentNameID'); foreach ($allAgent as $dd) { $fid .= ',' . $dd['uid']; } $where .= " AND a.fuid IN('" . $fid . "')"; } if ($get['year'] == "") { $get['year'] = $this->checkYearTime(9); } if ($get['userType'] != '') { if ($get['userType'] == 'DIY') { $where .= ' AND a.partid = -1'; } if ($get['userType'] == '中介') { $where .= ' AND a.partid <> -1'; } } $this->assign('show', $get); $order['field'] = 'lastAppDate'; $order['sortby'] = 'ASC'; //生成查询条件 if ($get['sortAppNum'] == 1) { $order['field'] = 'appNum'; $order['sortby'] = 'DESC'; } if ($get['sortOfferNum'] == 1) { $order['field'] = 'offerNum'; $order['sortby'] = 'DESC'; } if ($get['sortFirstAppDate'] == 1) { $order['field'] = 'firstAppDate'; $order['sortby'] = 'DESC'; } if ($get['sortLastAppDate'] == 1) { $order['field'] = 'lastAppDate'; $order['sortby'] = 'DESC'; } // 最终的条件 $post = ['appYear' => $get['year'], 'user_ao' => 0, 'firstName' => '', 'familyName' => '', 'sex' => '', 'birth' => '', 'nationality' => '', 'country' => '', 'addStartDate' => '', 'addEndDate' => '', 'user_ao' => '', 'is_ao_proc' => 1, 'sort' => $order]; $service = new StudentBaseSearchService(); $result = $service->baseSearch($post, TRUE, 20, $where); $lists = $result['lists']; $pageList = $result['pageList']; $this->assign('pageList', $pageList); foreach ($lists as $rs) { //判断是中介还是diy学生 if ($rs['partid'] == '-1') { $rs['partid'] = "DIY"; } else { // $rs['partid'] = "一级中介"; } //查找用户CAS状态 $c_status = M('apply_status')->where(array('s_no' => $rs['id']))->getField('c_status'); if ($c_status > 0) { $rs['cas'] = appStatus('3' . $c_status); } else { $rs['cas'] = '没有获取到CAS'; } //获取用户所在区域 $rs['area'] = M('server_area')->where(array('s_no' => $rs['stu_id']))->getField('name'); //获取用户名 $rs['username'] = M('user')->where(array('id' => $rs['stu_uid']))->getField('username'); $allList[] = $rs; } $this->assign('List', $allList); $this->display(); }
/** * @通过申请状态显示一个统一的申请状态 * @Author: 段涛 * @function name: getStatusInf * @param $a_status * @param $o_status * @param $c_status */ private function getStatusInf($a_status, $o_status, $c_status) { $status = appStatus(); $inf = appStatus(5); //默认状态为无效单 if ($a_status < 7) { $inf = $status['1' . $a_status]; } if ($a_status == 7 && $o_status < 5) { $inf = $status['2' . $o_status]; } if ($a_status == 7 && $o_status == 5) { $inf = $status['3' . $c_status]; } return $inf; }