PaperQuestionModel.php 744 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\admin\model\exam;
  3. use addons\exam\model\BaseModel;
  4. class PaperQuestionModel extends BaseModel
  5. {
  6. // use SoftDelete;
  7. // 表名
  8. protected $name = 'exam_paper_question';
  9. // 自动写入时间戳字段
  10. protected $autoWriteTimestamp = 'int';
  11. // 定义时间戳字段名
  12. protected $createTime = 'createtime';
  13. protected $updateTime = 'updatetime';
  14. // 追加属性
  15. protected $append = [];
  16. protected $type = [
  17. // 'answer' => 'array'
  18. ];
  19. public function paper()
  20. {
  21. return $this->belongsTo(PaperModel::class, 'paper_id', 'id');
  22. }
  23. public function question()
  24. {
  25. return $this->belongsTo(QuestionModel::class, 'question_id', 'id');
  26. }
  27. }