Bank.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Foundation\Auth\User as Authenticatable;
  5. use Illuminate\Notifications\Notifiable;
  6. use Laravel\Sanctum\HasApiTokens;
  7. /**
  8. * Admin
  9. * @mixin Builder
  10. * @method static Builder|static where($column, $operator = null, $value = null, $boolean = 'and')
  11. * @method static Builder|static create($data)
  12. * @property $id
  13. * @property $member_id
  14. * @property $channel
  15. * @property $bank_name
  16. * @property $account
  17. * @property $card_no
  18. * @property $alias
  19. *
  20. */
  21. class Bank extends Authenticatable
  22. {
  23. use HasApiTokens, Notifiable;
  24. protected $table = 'banks';
  25. protected $hidden = ['created_at', 'updated_at'];
  26. protected $fillable = ['member_id', 'channel', 'bank_name', 'account', 'card_no', 'alias'];
  27. public function getId()
  28. {
  29. return $this->id;
  30. }
  31. public function setMemberId($memberId): void
  32. {
  33. $this->member_id = $memberId;
  34. }
  35. public function getMemberId(): int
  36. {
  37. return $this->member_id;
  38. }
  39. public function getChannel(): string
  40. {
  41. return $this->channel;
  42. }
  43. public function getBankName(): string
  44. {
  45. return $this->bank_name;
  46. }
  47. public function getAccount(): string
  48. {
  49. return $this->account;
  50. }
  51. public function getAlias(): string
  52. {
  53. return $this->alias;
  54. }
  55. public function getCardNo(): string
  56. {
  57. return $this->card_no;
  58. }
  59. protected function getCreatedAtAttribute($value)
  60. {
  61. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  62. }
  63. protected function getUpdatedAtAttribute($value)
  64. {
  65. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  66. }
  67. }