重构DiceLotteryConfig为DiceLotteryPoolConfig
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\dice\model\play_record;
|
||||
|
||||
use app\dice\model\lottery_config\DiceLotteryConfig;
|
||||
use app\dice\model\lottery_pool_config\DiceLotteryPoolConfig;
|
||||
use app\dice\model\player\DicePlayer;
|
||||
use app\dice\model\reward_config\DiceRewardConfig;
|
||||
use plugin\saiadmin\basic\think\BaseModel;
|
||||
@@ -71,12 +71,12 @@ class DicePlayRecord extends BaseModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 彩金配置
|
||||
* 关联模型 diceLotteryConfig
|
||||
* 彩金池配置
|
||||
* 关联模型 diceLotteryPoolConfig
|
||||
*/
|
||||
public function diceLotteryConfig(): BelongsTo
|
||||
public function diceLotteryPoolConfig(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DiceLotteryConfig::class, 'lottery_config_id', 'id');
|
||||
return $this->belongsTo(DiceLotteryPoolConfig::class, 'lottery_config_id', 'id');
|
||||
}
|
||||
|
||||
/** 按玩家用户名模糊(dicePlayer.username) */
|
||||
@@ -93,13 +93,13 @@ class DicePlayRecord extends BaseModel
|
||||
}
|
||||
}
|
||||
|
||||
/** 按彩金池配置名称模糊(diceLotteryConfig.name) */
|
||||
/** 按彩金池配置名称模糊(diceLotteryPoolConfig.name) */
|
||||
public function searchLotteryConfigNameAttr($query, $value)
|
||||
{
|
||||
if ($value === '' || $value === null) {
|
||||
return;
|
||||
}
|
||||
$ids = DiceLotteryConfig::where('name', 'like', '%' . $value . '%')->column('id');
|
||||
$ids = DiceLotteryPoolConfig::where('name', 'like', '%' . $value . '%')->column('id');
|
||||
if (!empty($ids)) {
|
||||
$query->whereIn('lottery_config_id', $ids);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user