xhTrainUserCourse.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace common\models;
  3. /**
  4. * This is the model class for table "xhTrainUserCourse".
  5. *
  6. * @property integer $id
  7. * @property integer $userId
  8. * @property integer $studentId
  9. * @property integer $courseId
  10. * @property string $courseName
  11. * @property string $courseIntro
  12. * @property string $worksImg
  13. * @property integer $merchantId
  14. * @property integer $praiseNum
  15. * @property integer $status
  16. * @property integer $attendTime
  17. * @property integer $addTime
  18. * @property integer $modTime
  19. */
  20. class xhTrainUserCourse extends xhBaseModel
  21. {
  22. /**
  23. * @inheritdoc
  24. */
  25. public static function tableName()
  26. {
  27. return 'xhTrainUserCourse';
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['userId', 'studentId', 'courseId', 'merchantId', 'praiseNum', 'status', 'attendTime', 'addTime', 'modTime'], 'integer'],
  36. [['courseName'], 'string', 'max' => 30],
  37. [['courseIntro', 'worksImg'], 'string', 'max' => 1000],
  38. ];
  39. }
  40. /**
  41. * @inheritdoc
  42. */
  43. public function attributeLabels()
  44. {
  45. return [
  46. 'id' => 'ID',
  47. 'userId' => 'User ID',
  48. 'studentId' => 'Student ID',
  49. 'courseId' => 'Course ID',
  50. 'courseName' => 'Course Name',
  51. 'courseIntro' => 'Course Intro',
  52. 'worksImg' => 'Works Img',
  53. 'merchantId' => 'Merchant ID',
  54. 'praiseNum' => 'Praise Num',
  55. 'status' => 'Status',
  56. 'attendTime' => 'Attend Time',
  57. 'addTime' => 'Add Time',
  58. 'modTime' => 'Mod Time',
  59. ];
  60. }
  61. public function getXhUser()
  62. {
  63. return $this->hasOne(xhUser::className(),['id' => 'userId']);
  64. }
  65. }