[色子游戏]玩家抽奖记录
This commit is contained in:
78
server/app/dice/model/play_record/DicePlayRecord.php
Normal file
78
server/app/dice/model/play_record/DicePlayRecord.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | saiadmin [ saiadmin快速开发框架 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: your name
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\dice\model\play_record;
|
||||
|
||||
use app\dice\model\lottery_config\DiceLotteryConfig;
|
||||
use app\dice\model\player\DicePlayer;
|
||||
use app\dice\model\reward_config\DiceRewardConfig;
|
||||
use plugin\saiadmin\basic\think\BaseModel;
|
||||
use think\model\relation\BelongsTo;
|
||||
|
||||
/**
|
||||
* 玩家抽奖记录模型
|
||||
*
|
||||
* dice_play_record 玩家抽奖记录
|
||||
*
|
||||
* @property $id ID
|
||||
* @property $player_id 玩家id
|
||||
* @property $lottery_config_id 彩金池配置
|
||||
* @property $lottery_type 抽奖类型
|
||||
* @property $is_win 中奖
|
||||
* @property $win_coin 赢取平台币
|
||||
* @property $reward_config_id 奖励配置id
|
||||
* @property $lottery_id 奖池
|
||||
* @property $lottery_name 奖池名
|
||||
* @property $create_time 创建时间
|
||||
* @property $update_time 修改时间
|
||||
*/
|
||||
class DicePlayRecord extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 数据库表名称
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'dice_play_record';
|
||||
|
||||
/**
|
||||
* 奖池名 搜索
|
||||
*/
|
||||
public function searchLotteryNameAttr($query, $value)
|
||||
{
|
||||
$query->where('lottery_name', 'like', '%'.$value.'%');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联模型 dicePlayer
|
||||
*/
|
||||
public function dicePlayer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DicePlayer::class, 'player_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联模型 diceRewardConfig
|
||||
*/
|
||||
public function diceRewardConfig(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DiceRewardConfig::class, 'reward_config_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联模型 diceLotteryConfig
|
||||
*/
|
||||
public function diceLotteryConfig(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DiceLotteryConfig::class, 'lottery_config_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user