优化游玩记录DicePlayRecord
This commit is contained in:
@@ -31,6 +31,7 @@ use think\model\relation\BelongsTo;
|
||||
* @property $start_index 起始索引
|
||||
* @property $target_index 结束索引
|
||||
* @property $roll_array 摇取点数,格式:[1,2,3,4,5](5个点数)
|
||||
* @property $roll_number 摇取点数和(5个色子点数之和,5-30)
|
||||
* @property $lottery_name 奖池名
|
||||
* @property $status 状态:0=超时/失败 1=成功
|
||||
* @property $create_time 创建时间
|
||||
@@ -222,4 +223,20 @@ class DicePlayRecord extends BaseModel
|
||||
$query->where('direction', '=', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/** 摇取点数和下限 */
|
||||
public function searchRollNumberMinAttr($query, $value)
|
||||
{
|
||||
if ($value !== '' && $value !== null) {
|
||||
$query->where('roll_number', '>=', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/** 摇取点数和上限 */
|
||||
public function searchRollNumberMaxAttr($query, $value)
|
||||
{
|
||||
if ($value !== '' && $value !== null) {
|
||||
$query->where('roll_number', '<=', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user