ShareRedpackInvateLog.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace addons\ShareRedpack\common\models;
  3. use common\models\user\User;
  4. use Yii;
  5. /**
  6. * This is the model class for table "qimall_addons_share_redpack_invate_log".
  7. *
  8. * @property int $id
  9. * @property int $mall_id
  10. * @property int $invate_id share_redpack_invate.id
  11. * @property int $user_id 被邀请人的id
  12. * @property int $created_at 创建时间
  13. * @property int $updated_at 修改时间
  14. */
  15. class ShareRedpackInvateLog extends \common\models\base\BaseActiveRecord
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public static function tableName()
  21. {
  22. return 'qimall_addons_share_redpack_invate_log';
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function rules()
  28. {
  29. return [
  30. [['mall_id', 'invate_id', 'user_id'], 'required'],
  31. [['mall_id', 'invate_id', 'user_id', 'created_at', 'updated_at'], 'integer'],
  32. ];
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function attributeLabels()
  38. {
  39. return [
  40. 'id' => 'ID',
  41. 'mall_id' => 'Mall ID',
  42. 'invate_id' => 'Invate ID',
  43. 'user_id' => 'User ID',
  44. 'created_at' => 'Created At',
  45. 'updated_at' => 'Updated At',
  46. ];
  47. }
  48. /**
  49. * 关联用户表
  50. */
  51. public function getUser()
  52. {
  53. return $this->hasOne(User::class,['id'=>'user_id'])->select('nickname,avatar_url,mobile,username,id,created_at');
  54. }
  55. }