public function actionIndex() { //获取所有的组 $groupRs = BasicGroup::model()->findAll(array('select' => 'groupid,groupname', 'order' => 'groupid asc')); $group = array(); foreach ($groupRs as $value) { $group[] = array('id' => $value['groupid'], 'name' => mb_convert_encoding($value['groupname'], 'UTF-8', 'GBK')); } //获取所有的团队 $deptRs = BasicDept::model()->findAll(array('select' => 'deptid,deptname', 'order' => 'deptid asc')); $dept = array(); foreach ($deptRs as $value) { $dept[] = array('id' => $value['deptid'], 'name' => mb_convert_encoding($value['deptname'], 'UTF-8', 'GBK')); } $this->render('index', array('group' => $group, 'dept' => $dept)); }
public function getDeptName($data, $row) { $name = ''; $depts = CHtml::listData(BasicDept::model()->getNames(), 'deptid', 'deptname'); if (isset($depts[$data->dept])) { $name = $depts[$data->dept]; } return $name; }
if ($model->dept != '') { $deptModel = BasicDept::model()->getDeptById($model->dept); if ($deptModel != null) { $deptName = $deptModel->deptname; } } $updateDeptName = ''; if ($model->update_dept != '') { $deptModel = BasicDept::model()->getDeptById($model->update_dept); if ($deptModel != null) { $updateDeptName = $deptModel->deptname; } } $delayDeptName = ''; if ($model->delay_dept != '') { $deptModel = BasicDept::model()->getDeptById($model->delay_dept); if ($deptModel != null) { $delayDeptName = $deptModel->deptname; } } ?> <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?> /css/csms/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?> /css/csms/style.css" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl;