| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace App\Module\Mex\Models;
- use App\Module\GameItems\Models\Item;
- use UCore\ModelCore;
- /**
- * 农贸市场价格配置模型
- *
- * field start
- * @property int $id 配置ID,主键
- * @property int $item_id 商品ID,关联物品表
- * @property float $min_price 最低价(保底价)
- * @property float $max_price 最高价(参考价)
- * @property int $protection_threshold 数量保护阈值
- * @property bool $is_enabled 是否启用:0禁用,1启用
- * @property \Carbon\Carbon $created_at 创建时间
- * @property \Carbon\Carbon $updated_at 更新时间
- * field end
- *
- *
- */
- class MexPriceConfig extends ModelCore
- {
- protected $table = 'mex_price_configs';
- protected $casts = [
- 'item_id' => 'integer',
- 'min_price' => 'decimal:5',
- 'max_price' => 'decimal:5',
- 'protection_threshold' => 'integer',
- 'is_enabled' => 'boolean',
- ];
- /**
- * 物品关联
- * @return \Illuminate\Database\Eloquent\Relations\HasOne
- */
- public function item()
- {
- return $this->hasOne(Item::class, 'id', 'item_id');
- }
- }
|