CommentModel.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Models\Goodnight;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * App\Models\Goodnight\CommentModel
  6. *
  7. * @property int $id
  8. * @property int $uid 评论者
  9. * @property int $voice_id 语音ID
  10. * @property string $content 评论内容
  11. * @property \Illuminate\Support\Carbon $created_at 创建时间
  12. * @property \Illuminate\Support\Carbon $updated_at 修改时间
  13. * @property string $reply_content 回复内容
  14. * @property int $replyed_at 回复时间
  15. * @property int $deleted_at 删除时间
  16. * @property-read \App\Models\User\UserModel $user
  17. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel newModelQuery()
  18. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel newQuery()
  19. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel query()
  20. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereContent($value)
  21. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereCreatedAt($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereDeletedAt($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereId($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereReplyContent($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereReplyedAt($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereUid($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereUpdatedAt($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\CommentModel whereVoiceId($value)
  29. * @mixin \Eloquent
  30. */
  31. class CommentModel extends Model
  32. {
  33. //
  34. protected $table = 'kdgx_goodnight_voice_comments';
  35. protected $dateFormat = 'U';
  36. protected $fillable = ['uid', 'voice_id', 'content', 'reply_content', 'replyed_at', 'deleted_at'];
  37. public function user()
  38. {
  39. return $this->belongsTo(\App\Models\User\UserModel::class, 'uid', 'uid')->select('nickname', 'headimgurl');
  40. }
  41. }