CMSPayment.php 857 B

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