CashAccount.php 801 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: tandunzhao
  5. * Date: 2017/11/17
  6. * Time: 下午4:33
  7. */
  8. namespace App\Modules\Finance\Models;
  9. use Illuminate\Database\Eloquent\Model;
  10. /**
  11. * Class CashAccount 银行账户
  12. * @package App\Modules\Finance\Models
  13. */
  14. class CashAccount extends Model
  15. {
  16. protected $table = 'cash_accounts';
  17. protected $fillable = ['account_name','identity_card','card_number','account_bank','bank','province','status','bank_id', 'is_company', 'phone', 'distribution_channel_id'];
  18. /**
  19. * 根据渠道ID获取CashAccount
  20. * @param $distribution_channel_id
  21. * @return mixed
  22. */
  23. static function getByDistributionChannel($distribution_channel_id)
  24. {
  25. return self::where('distribution_channel_id',$distribution_channel_id)->first();
  26. }
  27. }