CorrectionQuestionModel.php 591 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace addons\exam\model;
  3. class CorrectionQuestionModel extends \app\admin\model\exam\CorrectionQuestionModel
  4. {
  5. // 追加属性
  6. protected $append = [
  7. 'createtime_text',
  8. 'status_text'
  9. ];
  10. public function getStatusList()
  11. {
  12. return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2')];
  13. }
  14. public function user()
  15. {
  16. return $this->belongsTo(UserModel::class, 'user_id', 'id');
  17. }
  18. public function question()
  19. {
  20. return $this->belongsTo(QuestionModel::class, 'question_id', 'id');
  21. }
  22. }