VoiceModel.php 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace App\Models\Goodnight;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. /**
  6. * App\Models\Goodnight\VoiceModel
  7. *
  8. * @property int $id
  9. * @property \Illuminate\Support\Carbon $created_at 创建时间
  10. * @property \Illuminate\Support\Carbon $updated_at 更新时间
  11. * @property int|null $deleted_at 删除时间
  12. * @property int $uid 用户
  13. * @property int $sex 性别0未知1男2女
  14. * @property string $cover 封面地址
  15. * @property string $voice 声音地址
  16. * @property string $tags 标签
  17. * @property int $check 审核:0待审核;1通过;-1不通过
  18. * @property int $like 喜欢的数量
  19. * @property int $view 推送次数
  20. * @property int $commit 推荐
  21. * @property int $expedit
  22. * @property int $topic_id topic
  23. * @property int $topic_example_id examples
  24. * @property-read \App\Models\User\UserModel $user
  25. * @method static bool|null forceDelete()
  26. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel newModelQuery()
  27. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel newQuery()
  28. * @method static \Illuminate\Database\Query\Builder|\App\Models\Goodnight\VoiceModel onlyTrashed()
  29. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel query()
  30. * @method static bool|null restore()
  31. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereCheck($value)
  32. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereCommit($value)
  33. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereCover($value)
  34. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereCreatedAt($value)
  35. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereDeletedAt($value)
  36. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereExpedit($value)
  37. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereId($value)
  38. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereLike($value)
  39. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereSex($value)
  40. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereTags($value)
  41. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereTopicExampleId($value)
  42. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereTopicId($value)
  43. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereUid($value)
  44. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereUpdatedAt($value)
  45. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereView($value)
  46. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\VoiceModel whereVoice($value)
  47. * @method static \Illuminate\Database\Query\Builder|\App\Models\Goodnight\VoiceModel withTrashed()
  48. * @method static \Illuminate\Database\Query\Builder|\App\Models\Goodnight\VoiceModel withoutTrashed()
  49. * @mixin \Eloquent
  50. */
  51. class VoiceModel extends Model
  52. {
  53. use SoftDeletes;
  54. protected $table = "kdgx_goodnight_voice";
  55. protected $dateFormat = 'U';
  56. protected $fillable = [
  57. 'uid',
  58. 'sex',
  59. 'deleted_at',
  60. 'cover',
  61. 'voice',
  62. 'tags',
  63. 'check',
  64. 'like',
  65. 'view',
  66. 'commit',
  67. 'expedit',
  68. 'topic_id',
  69. 'topic_example_id'
  70. ];
  71. public function user()
  72. {
  73. return $this->belongsTo(\App\Models\User\UserModel::class, 'uid', 'uid')->select(
  74. 'nickname',
  75. 'headimgurl',
  76. 'sex'
  77. );
  78. }
  79. }