重构*_weight为*_weight

This commit is contained in:
2026-03-07 10:07:44 +08:00
parent 7e5585aee0
commit fe1ceeb4fb
9 changed files with 127 additions and 128 deletions

View File

@@ -23,17 +23,17 @@ use app\dice\model\lottery_config\DiceLotteryConfig;
* @property $status 状态
* @property $coin 平台币
* @property $is_up 倍率
* @property $t1_wight T1池权重
* @property $t2_wight T2池权重
* @property $t3_wight T3池权重
* @property $t4_wight T4池权重
* @property $t5_wight T5池权重
* @property $t1_weight T1池权重
* @property $t2_weight T2池权重
* @property $t3_weight T3池权重
* @property $t4_weight T4池权重
* @property $t5_weight T5池权重
* @property $total_ticket_count 总抽奖次数
* @property $paid_ticket_count 购买抽奖次数
* @property $free_ticket_count 赠送抽奖次数
* @property $created_at 创建时间
* @property $updated_at 更新时间
* @property $deleted_at 删除时间
* @property $create_time 创建时间
* @property $update_time 更新时间
* @property $delete_time 删除时间
*/
class DicePlayer extends BaseModel
{
@@ -49,10 +49,9 @@ class DicePlayer extends BaseModel
*/
protected $table = 'dice_player';
/** 创建时间字段dice_player 表为 created_at */
protected $createTime = 'created_at';
/** 更新时间字段dice_player 表为 updated_at */
protected $updateTime = 'updated_at';
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
/**
* 新增前:生成唯一 uid昵称 name 默认使用 uid
@@ -83,7 +82,7 @@ class DicePlayer extends BaseModel
}
/**
* 从 DiceLotteryConfig type=0 取 t1_wightt5_wight 作为玩家未设置时的默认值
* 从 DiceLotteryConfig type=0 取 t1_weightt5_weight 作为玩家未设置时的默认值
*/
protected static function setDefaultWeightsFromLotteryConfig(DicePlayer $model): void
{
@@ -91,7 +90,7 @@ class DicePlayer extends BaseModel
if (!$config) {
return;
}
$fields = ['t1_wight', 't2_wight', 't3_wight', 't4_wight', 't5_wight'];
$fields = ['t1_weight', 't2_weight', 't3_weight', 't4_weight', 't5_weight'];
foreach ($fields as $field) {
try {
$val = $model->getAttr($field);