CommentInfoModel.php 719 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class CommentInfoModel extends Model
  5. {
  6. protected $table = 'comments_info';
  7. protected $fillable = [
  8. 'interaction_id',
  9. 'user_id',
  10. 'level',
  11. 'content',
  12. 'is_read',
  13. ];
  14. protected $hidden = ['dream_id','created_at','deleted_at','id'];
  15. public function CommentUser()
  16. {
  17. return $this->belongsTo('App\Models\UserInfoModel','user_id','id');
  18. }
  19. public function dream()
  20. {
  21. return $this->hasOne('App\Models\DreamInfoModel','id','dream_id');
  22. }
  23. public function replay()
  24. {
  25. return $this->hasMany('App\Models\ReplyCommentsInfo','comment_id','id');
  26. }
  27. }