feat: 添加新的错误码以支持配置版本管理,更新彩票配置以启用手动审核,增强 API 路由以支持玩法和赔率版本化管理
This commit is contained in:
42
app/Models/OddsItem.php
Normal file
42
app/Models/OddsItem.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* {@see odds_items}
|
||||
*
|
||||
* `odds_value`:整数,**赔率乘数 × 10000**(例如 19500 表示 1.9500 倍)。
|
||||
*/
|
||||
class OddsItem extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'version_id',
|
||||
'play_code',
|
||||
'prize_scope',
|
||||
'odds_value',
|
||||
'rebate_rate',
|
||||
'commission_rate',
|
||||
'currency_code',
|
||||
'extra_config_json',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'version_id' => 'integer',
|
||||
'odds_value' => 'integer',
|
||||
'rebate_rate' => 'decimal:4',
|
||||
'commission_rate' => 'decimal:4',
|
||||
'extra_config_json' => 'json',
|
||||
];
|
||||
}
|
||||
|
||||
/** @return BelongsTo<OddsVersion, OddsItem> */
|
||||
public function version(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(OddsVersion::class, 'version_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user