EmailCert.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%email_cert}}".
  6. *
  7. * @property int $id ID
  8. * @property int $user_id 用户ID
  9. * @property string|null $email 邮箱
  10. * @property string|null $cert_key 验证码
  11. * @property int $cert 1:验证 0:未验证
  12. * @property int $request_from 请求来源
  13. * @property int $sent_time 验证码发送时间
  14. * @property int $cert_time 验证时间
  15. */
  16. class EmailCert extends \app\common\models\EActiveRecord
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public static function tableName()
  22. {
  23. return '{{%email_cert}}';
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function rules()
  29. {
  30. return [
  31. [['user_id', 'cert', 'request_from', 'sent_time', 'cert_time'], 'integer'],
  32. [['email'], 'string', 'max' => 50],
  33. [['cert_key'], 'string', 'max' => 15],
  34. ];
  35. }
  36. /**
  37. * {@inheritdoc}
  38. */
  39. public function attributeLabels()
  40. {
  41. return [
  42. 'id' => 'ID',
  43. 'user_id' => '用户ID',
  44. 'email' => '邮箱',
  45. 'cert_key' => '验证码',
  46. 'cert' => '1:验证 0:未验证',
  47. 'request_from' => '请求来源',
  48. 'sent_time' => '验证码发送时间',
  49. 'cert_time' => '验证时间',
  50. ];
  51. }
  52. }