MemberBankModel.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 LARAVEL研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: laravel开发员 <laravel.qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Models;
  12. /**
  13. * 收款账户-模型
  14. * @author laravel开发员
  15. * @since 2020/11/11
  16. * @package App\Models
  17. */
  18. class MemberBankModel extends BaseModel
  19. {
  20. // 设置数据表
  21. protected $table = 'member_banks';
  22. protected $appends = ['bank_card_text','bank_text'];
  23. public function getBankCardTextAttribute()
  24. {
  25. return $this->account? format_bank_card($this->account) : '';
  26. }
  27. public function getBankTextAttribute()
  28. {
  29. return $this->account_name?$this->account_name.'('.substr($this->account,-4,4).')':'';
  30. }
  31. }