WalletFreezeRecord.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Models;
  3. /** 冻结记录:人工冻结、人工解冻、提现冻结。 */
  4. class WalletFreezeRecord extends BaseModel
  5. {
  6. public const TYPE_MANUAL_FREEZE = 'manual_freeze';
  7. public const TYPE_MANUAL_UNFREEZE = 'manual_unfreeze';
  8. public const TYPE_WITHDRAW_HOLD = 'withdraw_hold';
  9. public const STATUS_FROZEN = 'frozen';
  10. public const STATUS_DONE = 'done';
  11. public const STATUS_HOLDING = 'holding';
  12. public const STATUS_RELEASED = 'released';
  13. public const STATUS_SETTLED = 'settled';
  14. public const TYPE_LABELS = [
  15. self::TYPE_MANUAL_FREEZE => '人工冻结',
  16. self::TYPE_MANUAL_UNFREEZE => '人工解冻',
  17. self::TYPE_WITHDRAW_HOLD => '提现冻结',
  18. ];
  19. public const STATUS_LABELS = [
  20. self::STATUS_FROZEN => '已冻结',
  21. self::STATUS_DONE => '已解冻',
  22. self::STATUS_HOLDING => '提现审核中',
  23. self::STATUS_RELEASED => '已退回余额',
  24. self::STATUS_SETTLED => '提现成功已扣除',
  25. ];
  26. protected $table = 'wallet_freeze_records';
  27. protected $hidden = ['updated_at'];
  28. protected $fillable = ['user_id', 'member_id', 'type', 'amount', 'wager_amount', 'reason', 'status', 'related_type',
  29. 'related_id', 'request_id', 'admin_id', 'before_available', 'after_available', 'before_frozen', 'after_frozen', 'finished_at'];
  30. public function member()
  31. {
  32. return $this->belongsTo(User::class, 'member_id', 'member_id')->select(['id', 'member_id', 'username', 'account', 'first_name']);
  33. }
  34. }