12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- /**
- * Created by 上海互教教育科技有限公司.
- * User: 刘红伟
- * Date: 2016/7/19
- * Email: 454303753@qq.com
- * File:CMSOrder.php
- */
- class CMSOrderClazz extends CActiveRecord{
- public function getDbConnection() {
- return Yii::app()->db251;
- }
- public static function model($className = __CLASS__){
- return parent::model($className);
- }
- public function tableName(){
- return "order_clazz";
- }
- public function primaryKey(){
- return array('id');
- }
- public function getOrderIDByClassId($class_id='')
- {
- $criteria = new CDbCriteria();
- if($class_id)
- {
- $criteria->addCondition('clazz_id=:clazz_id');
- $criteria->params[':clazz_id'] = $class_id;
- }
- $data = $this->findAll($criteria);
-
- if($data)
- {
- return $data;
- }
- return false;
- }
-
- public function getOrderIDInClassId($class_ids=array())
- {
- $criteria = new CDbCriteria();
- if($class_ids)
- {
-
- $criteria->addInCondition('clazz_id ',$class_ids);
- // $criteria->params[':clazz_id'] = implode(",", $class_ids);
- }
- $data = $this->findAll($criteria);
-
- if($data)
- {
- return $data;
- }
- return false;
- }
- }
|