MexPriceConfig.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Module\Mex\Models;
  3. use App\Module\GameItems\Models\Item;
  4. use UCore\ModelCore;
  5. /**
  6. * 农贸市场价格配置模型
  7. *
  8. * field start
  9. * @property int $id 配置ID,主键
  10. * @property int $item_id 商品ID,关联物品表
  11. * @property float $min_price 最低价(保底价)
  12. * @property float $max_price 最高价(参考价)
  13. * @property int $protection_threshold 数量保护阈值
  14. * @property bool $is_enabled 是否启用:0禁用,1启用
  15. * @property \Carbon\Carbon $created_at 创建时间
  16. * @property \Carbon\Carbon $updated_at 更新时间
  17. * field end
  18. *
  19. *
  20. */
  21. class MexPriceConfig extends ModelCore
  22. {
  23. protected $table = 'mex_price_configs';
  24. protected $casts = [
  25. 'item_id' => 'integer',
  26. 'min_price' => 'decimal:5',
  27. 'max_price' => 'decimal:5',
  28. 'protection_threshold' => 'integer',
  29. 'is_enabled' => 'boolean',
  30. ];
  31. /**
  32. * 物品关联
  33. * @return \Illuminate\Database\Eloquent\Relations\HasOne
  34. */
  35. public function item()
  36. {
  37. return $this->hasOne(Item::class, 'id', 'item_id');
  38. }
  39. }