LoginTimes.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%login_times}}".
  6. *
  7. * @property string $user_name 用户名
  8. * @property int $ip IP
  9. * @property int $login_time 登陆时间
  10. * @property int $is_admin 是否管理员
  11. * @property int $times 次数
  12. */
  13. class LoginTimes extends \app\common\models\EActiveRecord
  14. {
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public static function tableName()
  19. {
  20. return '{{%login_times}}';
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function rules()
  26. {
  27. return [
  28. [['user_name'], 'required'],
  29. [['ip', 'login_time', 'is_admin', 'times'], 'integer'],
  30. [['user_name'], 'string', 'max' => 40],
  31. [['user_name'], 'unique'],
  32. ];
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function attributeLabels()
  38. {
  39. return [
  40. 'user_name' => 'User Name',
  41. 'ip' => 'Ip',
  42. 'login_time' => 'Login Time',
  43. 'is_admin' => 'Is Admin',
  44. 'times' => 'Times',
  45. ];
  46. }
  47. }