此代码不起作用,因为它应该起作用我想使用 between and 子句检查开始和结束期间之间的 period_id 但无法做到
$return = Yii::app()->db->createCommand()
->select('period_id')
->from('SCHOOL_PERIODS')
->where('school_id=:school_id', array(':school_id'=>$schoolId))
->andWhere('syear=:syear', array(':syear'=>$schoolYear))
->andWhere('ignore_scheduling IS NULL')
->andWhere('period_id>:start', array(':start' => $startPeriod))
->andWhere('period_id<:end', array(':end' => $maxPeriod))
->order('sort_order asc')
->queryAll();
return $return;