xhStudent.php 815 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace common\models;
  3. class xhStudent extends xhBaseModel
  4. {
  5. /**
  6. * @inheritdoc
  7. */
  8. public static function tableName()
  9. {
  10. return 'xhStudent';
  11. }
  12. /**
  13. * @inheritdoc
  14. */
  15. public function rules()
  16. {
  17. return [
  18. [['id','userId', 'merchantId', 'visitTime', 'addTime', 'modTime'], 'integer'],
  19. ];
  20. }
  21. /**
  22. * @inheritdoc
  23. */
  24. public function attributeLabels()
  25. {
  26. return [
  27. 'id' => 'ID',
  28. 'userId' => 'User ID',
  29. 'merchantId' => 'Merchant ID',
  30. 'visitTime' => 'visitTime',
  31. 'addTime' => 'Add Time',
  32. 'modTime' => 'Mod Time',
  33. ];
  34. }
  35. public function getXhUser()
  36. {
  37. return $this->hasOne(xhUser::className(), ['id' => 'userId']);
  38. }
  39. }