12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- /**
- * 学生提分册模型类
- * @author jiangfei
- * @date 2015-08-17 18:28:00
- * @company 上海风车教育有限公司.
- */
- class StudentImproveScorePlan extends MyActiveRecord{
- public static function model($className = __CLASS__){
- return parent::model($className);
- }
- public function tableName(){
- return "student_improve_score_plan";
- }
- public function getReportDataByPlanId($planId){
- $result = FALSE;
-
- if ($planId AND is_numeric($planId)) {
- $detail = $this->find('plan_id=:plid',array(':plid'=>$planId));
- if ($detail && $detail['report_created'] && $detail['report_data']){
- $result = json_decode($detail['report_data'], TRUE);
- }
- }
-
- return $result;
- }
-
- // 根据学生ids、paperid获取提分册
- public function getPlansByPaperIdSids($paperId,$studentIds) {
- $result = array();
- if ($paperId && is_numeric($paperId) && $studentIds && is_array($studentIds)){
- $criteria = new CDbCriteria();
- $criteria->addCondition("paper_id = '". $paperId ."' AND student_id IN (". implode(',', $studentIds) .")");
- $result = $this->findAll($criteria);
- }
- return $result;
- }
- }
|