FundConfigModel.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Module\Fund\Models;
  3. use UCore\ModelCore;
  4. /**
  5. * 账户种类配置表
  6. *
  7. * 用于存储系统支持的各种账户种类,如可用账户、冻结账户等。
  8. * 同一个币种(FundCurrencyModel)可以有多个不同的账户种类。
  9. *
  10. * field start
  11. * @property int $id 自增
  12. * @property string $name 资金名字
  13. * @property int $currency_id 关联的币种ID,外键关联kku_fund_currency表
  14. * @property int $create_time
  15. * @property int $update_time 更新时间
  16. * field end
  17. */
  18. class FundConfigModel extends ModelCore
  19. {
  20. protected $table = 'fund_config';
  21. // attrlist start
  22. protected $fillable = [
  23. 'id',
  24. 'name',
  25. 'currency_id',
  26. 'create_time',
  27. 'update_time',
  28. ];
  29. // attrlist end
  30. public $timestamps = false;
  31. /**
  32. * 获取关联的币种
  33. *
  34. * 一个账户种类属于一个币种,这是一对多关系中的"多"一方
  35. *
  36. * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
  37. */
  38. public function currency()
  39. {
  40. return $this->belongsTo(FundCurrencyModel::class, 'currency_id');
  41. }
  42. }