[色子游戏]玩家抽奖记录-优化样式
This commit is contained in:
@@ -9,6 +9,9 @@ namespace app\dice\controller\play_record;
|
||||
use plugin\saiadmin\basic\BaseController;
|
||||
use app\dice\logic\play_record\DicePlayRecordLogic;
|
||||
use app\dice\validate\play_record\DicePlayRecordValidate;
|
||||
use app\dice\model\player\DicePlayer;
|
||||
use app\dice\model\lottery_config\DiceLotteryConfig;
|
||||
use app\dice\model\reward_config\DiceRewardConfig;
|
||||
use plugin\saiadmin\service\Permission;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
@@ -37,8 +40,14 @@ class DicePlayRecordController extends BaseController
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$where = $request->more([
|
||||
['username', ''],
|
||||
['lottery_config_name', ''],
|
||||
['lottery_type', ''],
|
||||
['lottery_name', ''],
|
||||
['is_win', ''],
|
||||
['win_coin_min', ''],
|
||||
['win_coin_max', ''],
|
||||
['reward_ui_text', ''],
|
||||
['reward_tier', ''],
|
||||
]);
|
||||
$query = $this->logic->search($where);
|
||||
$query->with([
|
||||
@@ -50,6 +59,49 @@ class DicePlayRecordController extends BaseController
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家选项(id、username)
|
||||
*/
|
||||
#[Permission('玩家抽奖记录列表', 'dice:play_record:index:index')]
|
||||
public function getPlayerOptions(Request $request): Response
|
||||
{
|
||||
$list = DicePlayer::field('id,username')->select();
|
||||
$data = $list->map(function ($item) {
|
||||
return ['id' => $item['id'], 'username' => $item['username'] ?? ''];
|
||||
})->toArray();
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取彩金池配置选项(id、name)
|
||||
*/
|
||||
#[Permission('玩家抽奖记录列表', 'dice:play_record:index:index')]
|
||||
public function getLotteryConfigOptions(Request $request): Response
|
||||
{
|
||||
$list = DiceLotteryConfig::field('id,name')->select();
|
||||
$data = $list->map(function ($item) {
|
||||
return ['id' => $item['id'], 'name' => $item['name'] ?? ''];
|
||||
})->toArray();
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取奖励配置选项(id、ui_text、tier)
|
||||
*/
|
||||
#[Permission('玩家抽奖记录列表', 'dice:play_record:index:index')]
|
||||
public function getRewardConfigOptions(Request $request): Response
|
||||
{
|
||||
$list = DiceRewardConfig::field('id,ui_text,tier')->select();
|
||||
$data = $list->map(function ($item) {
|
||||
return [
|
||||
'id' => $item['id'],
|
||||
'ui_text' => $item['ui_text'] ?? '',
|
||||
'tier' => $item['tier'] ?? ''
|
||||
];
|
||||
})->toArray();
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取数据
|
||||
* @param Request $request
|
||||
|
||||
Reference in New Issue
Block a user