UserPunish.php 909 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Module\Ulogic\Models;
  3. use App\Models\ModelCore;
  4. use App\Module\Ulogic\Enum\PUNISH_TYPE;
  5. use Illuminate\Database\Eloquent\Relations\HasOne;
  6. /**
  7. * 用户 惩罚(违规记录)
  8. * punish
  9. *
  10. * field start
  11. * @property int $id
  12. * @property int $user_id 用户ID
  13. * @property string $type 类型
  14. * @property \Carbon\Carbon $created_at
  15. * @property \Carbon\Carbon $updated_at
  16. * @property string $desc 描述
  17. * @property int $level 惩罚等级
  18. * @property \Carbon\Carbon $deleted_at
  19. * @property int $admin_id 做出惩罚的管理员ID
  20. * field end
  21. *
  22. *
  23. *
  24. *
  25. */
  26. class UserPunish extends ModelCore
  27. {
  28. protected $table = 'user_punishs';
  29. protected $casts = [
  30. 'type' => PUNISH_TYPE::class
  31. ];
  32. public function user(): HasOne
  33. {
  34. return $this->hasOne(\App\Module\User\Model\User::class, 'user_id', 'user_id');
  35. }
  36. }