CommentInfoModel.php 700 B

123456789101112131415161718192021222324252627282930313233
  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. ];
  13. protected $hidden = ['dream_id','created_at','deleted_at','id'];
  14. public function CommentUser()
  15. {
  16. return $this->belongsTo('App\Models\UserInfoModel','user_id','id');
  17. }
  18. public function dream()
  19. {
  20. return $this->hasOne('App\Models\DreamInfoModel','id','dream_id');
  21. }
  22. public function replay()
  23. {
  24. return $this->hasMany('App\Models\ReplyCommentsInfo','comment_id','id');
  25. }
  26. }