FundCurrencyModel.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Module\Fund\Models;
  3. use UCore\ModelCore;
  4. /**
  5. * 币种配置表
  6. *
  7. * 用于存储系统支持的各种币种信息,如美元、人民币、比特币等。
  8. * 一个币种可以对应多个账户种类(FundConfigModel)。
  9. *
  10. * field start
  11. * @property int $id 自增
  12. * @property string $identification 资金标识
  13. * @property string $icon 资金标识
  14. * @property string $name 资金名字
  15. * @property string $data1 数据
  16. * @property int $create_time
  17. * @property int $update_time 更新时间
  18. * field end
  19. */
  20. class FundCurrencyModel extends ModelCore
  21. {
  22. protected $table = 'fund_currency';
  23. // attrlist start
  24. protected $fillable = [
  25. 'id',
  26. 'identification',
  27. 'icon',
  28. 'name',
  29. 'data1',
  30. 'create_time',
  31. 'update_time',
  32. ];
  33. // attrlist end
  34. public $timestamps = false;
  35. /**
  36. * 获取该币种的所有账户种类
  37. *
  38. * 一个币种可以有多个账户种类,这是一对多关系中的"一"一方
  39. *
  40. * @return \Illuminate\Database\Eloquent\Relations\HasMany
  41. */
  42. public function fundConfigs()
  43. {
  44. return $this->hasMany(FundConfigModel::class, 'currency_id');
  45. }
  46. }