ExamPaper.php 414 B

12345678910111213141516171819
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class ExamPaper extends Model
  5. {
  6. public $got_total_score = 0;
  7. public $done = 0;
  8. public $checked = 0;
  9. //relaitonship
  10. public function questions(){
  11. return $this->belongsToMany('ExamQuestion','exam_paper_question','question_id','paper_id');
  12. }
  13. public function result(){
  14. return $this->hasMany('ExamEmpResult','paper_id');
  15. }
  16. }