123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class CommentInfoModel extends Model
- {
- protected $table = 'comments_info';
- protected $fillable = [
- 'interaction_id',
- 'user_id',
- 'level',
- 'content',
- 'is_read',
- ];
- protected $hidden = ['dream_id','created_at','deleted_at','id'];
- public function CommentUser()
- {
- return $this->belongsTo('App\Models\UserInfoModel','user_id','id');
- }
- public function to_user()
- {
- return $this->belongsTo('App\Models\UserInfoModel');
- }
- public function dream()
- {
- return $this->hasOne('App\Models\DreamInfoModel','id','dream_id');
- }
- public function replay()
- {
- return $this->hasMany('App\Models\ReplyCommentsInfo','comment_id','id');
- }
- }
|