RechargeLog.php 951 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: PHP
  5. * Date: 2016/9/26
  6. * Time: 11:57
  7. * 会员充值日志
  8. */
  9. class RechargeLog extends MongoAr
  10. {
  11. public $_id;
  12. public $user;//充值用户 mongoid
  13. public $time;//充值时间
  14. public $recharge;//充值卡 mongoid
  15. public function __construct($scenario='insert'){
  16. $this->setMongoDBComponent(Yii::app()->getComponent('mongodb_o2o'));
  17. parent::__construct($scenario);
  18. }
  19. public static function model($className=__CLASS__)
  20. {
  21. return parent::model($className);
  22. }
  23. public function getCollectionName()
  24. {
  25. return 'recharge_log';
  26. }
  27. public static function get($_id) {
  28. if(CommonFn::isMongoId($_id)){
  29. $criteria = new EMongoCriteria();
  30. $criteria->_id('==', $_id);
  31. $model = self::model()->find($criteria);
  32. return $model;
  33. }else{
  34. return false;
  35. }
  36. }
  37. }