| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- namespace common\models;
- use common\components\MongoActiveRecord;
- use Yii;
- /**
- * This is the model class for collection "ar_bonus_admin_login".
- *
- * @property \MongoDB\BSON\ObjectID|string $_id
- * @property mixed $user_name
- * @property mixed $opt_type
- * @property mixed $return_result
- * @property mixed $success_times
- * @property mixed $fail_times
- * @property mixed $device
- * @property mixed $request_route
- * @property mixed $ip
- * @property mixed $created_at
- * @property mixed $user_agent
- * @property mixed $period_num
- * @property mixed $version
- */
- class LogUserLogin extends MongoActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function collectionName()
- {
- return 'ar_bonus_user_login';
- }
- /**
- * @return \yii\mongodb\Connection the MongoDB connection used by this AR class.
- */
- public static function getDb()
- {
- return Yii::$app->get('dbLog');
- }
- /**
- * 获取id
- * @return string
- */
- public function getId() {
- return (string) $this->_id;
- }
- /**
- * {@inheritdoc}
- */
- public function attributes()
- {
- return [
- '_id',
- 'user_name',
- 'ip',
- 'created_at',
- 'user_agent',
- 'period_num',
- 'opt_type',
- 'success_times',
- 'fail_times',
- 'device',
- 'request_route',
- 'return_result',
- 'version'
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['user_name', 'ip', 'request_route'], 'required'],
- [['created_at', 'success_times', 'period_num', 'fail_times'], 'integer'],
- [['user_name', 'ip', 'opt_type'], 'string', 'max' => 16],
- [['_id', 'return_result', 'device',], 'safe'],
- [['user_agent', 'request_route'], 'string', 'max' => 1000],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- '_id' => 'ID',
- 'user_name' => '对象编号',
- 'ip' => '操作ip',
- 'created_at' => '创建时间',
- 'user_agent' => '浏览器特征',
- 'period_num' => '期数',
- 'opt_type' => '操作类型',
- 'success_times' => '登陆成功次数',
- 'fail_times' => '登录失败次数',
- 'device' => '客户端',
- 'request_route' => '请求路径',
- 'return_result' => '返回内容',
- 'version' => '版本',
- ];
- }
- }
|