12345678910111213141516171819202122232425262728 |
- <?php
- namespace App\Model\qw;
- use Illuminate\Database\Eloquent\Model;
- class QwSub extends Model
- {
- public $table = "jm_qw_sub";
- public $timestamps = false;
- /**
- * 追加属性
- */
- protected $appends = [
- 'question_text'
- ];
- public function getQuestionTextAttribute()
- {
- $question = Qw::find($this->question_id);
- return $question->question ?? '';
- }
- }
|