1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- /**
- * 学生与班级关系模型类
- * @author jiangfei
- * @date 2015-09-01 18:28:00
- * @company 上海风车教育有限公司.
- */
- class StudentToClass extends MyActiveRecord{
- public static function model($className = __CLASS__){
- return parent::model($className);
- }
- public function tableName(){
- return "student_class_relation";
- }
-
- // 获取班级学生学号
- public function getStudentNoByStudentId($classId){
- $result = array();
- if (!empty($classId) && is_numeric($classId)) {
- //$criteria = new CDbCriteria();
- $getInfo = $this->findAll('class_id=:clid',array(':clid'=>$classId));
- if (!empty($getInfo)) {
- foreach ($getInfo as $val) {
- $result[$val->student_id] = $val->userno;
- }
- }
- }
-
- return $result;
- }
- }
|