Bank.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. * @property $id
  12. * @property $member_id
  13. * @property $channel
  14. * @property $bank_name
  15. * @property $account
  16. * @property $card_no
  17. * @property $alias
  18. *
  19. */
  20. class Bank extends Authenticatable
  21. {
  22. use HasApiTokens, Notifiable;
  23. protected $table = 'banks';
  24. protected $hidden = ['created_at', 'updated_at'];
  25. protected $fillable = ['member_id', 'channel', 'bank_name', 'account', 'card_no', 'alias'];
  26. public function getId()
  27. {
  28. return $this->id;
  29. }
  30. public function setMemberId($memberId): void
  31. {
  32. $this->member_id = $memberId;
  33. }
  34. public function getMemberId(): int
  35. {
  36. return $this->member_id;
  37. }
  38. public function getChannel(): string
  39. {
  40. return $this->channel;
  41. }
  42. public function getBankName(): string
  43. {
  44. return $this->bank_name;
  45. }
  46. public function getAccount(): string
  47. {
  48. return $this->account;
  49. }
  50. public function getAlias(): string
  51. {
  52. return $this->alias;
  53. }
  54. public function getCardNo(): string
  55. {
  56. return $this->card_no;
  57. }
  58. protected function getCreatedAtAttribute($value)
  59. {
  60. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  61. }
  62. protected function getUpdatedAtAttribute($value)
  63. {
  64. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  65. }
  66. }