CMSOrderGoods.php 772 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Created by 上海互教教育科技有限公司.
  4. * User: 刘红伟
  5. * Date: 2016/7/19
  6. * Email: 454303753@qq.com
  7. * File:CMSOrderGoods.php
  8. */
  9. class CMSOrderGoods extends CActiveRecord
  10. {
  11. public function getDbConnection()
  12. {
  13. return Yii::app()->db251;
  14. }
  15. public static function model($className = __CLASS__)
  16. {
  17. return parent::model($className);
  18. }
  19. public function tableName()
  20. {
  21. return "order_goods";
  22. }
  23. public function getGoodsByOrderId($order_ids)
  24. {
  25. $criteria = new CDbCriteria();
  26. $criteria->addInCondition('order_id',$order_ids);
  27. $data = $this->findAll($criteria);
  28. if($data)
  29. {
  30. return $data;
  31. }
  32. return false;
  33. }
  34. }