FeedComment.php 600 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\Model;
  5. class FeedComment extends Model
  6. {
  7. use HasDateTimeFormatter;
  8. protected $table = 'feed_comment';
  9. protected $fillable = ['feed_id', 'user_id','content','pid','to_uid'];
  10. public function user()
  11. {
  12. return $this->belongsTo(User::class,'user_id','id');
  13. }
  14. public function to_user()
  15. {
  16. return $this->belongsTo(User::class,'to_uid','id');
  17. }
  18. public function feed()
  19. {
  20. return $this->belongsTo(Feed::class,'feed_id','id');
  21. }
  22. }