1.将部门修改为渠道,并且所有dice_表关联渠道表
2.将所有配置表,记录表设置关联渠道 3.优化后台页面设置
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\dice\controller\reward;
|
||||
|
||||
use app\dice\helper\AdminScopeHelper;
|
||||
use app\dice\logic\reward\DiceRewardLogic;
|
||||
use app\dice\logic\reward_config_record\DiceRewardConfigRecordLogic;
|
||||
use app\dice\model\reward\DiceReward;
|
||||
@@ -42,11 +43,18 @@ class DiceRewardController extends BaseController
|
||||
$orderType = $request->input('orderType', 'asc');
|
||||
|
||||
$logic = new DiceRewardLogic();
|
||||
$data = $logic->getListWithConfig($direction, [
|
||||
'tier' => $tier,
|
||||
'orderField' => $orderField,
|
||||
'orderType' => $orderType,
|
||||
], $page, $limit);
|
||||
$data = $logic->getListWithConfig(
|
||||
$direction,
|
||||
[
|
||||
'tier' => $tier,
|
||||
'orderField' => $orderField,
|
||||
'orderType' => $orderType,
|
||||
],
|
||||
$page,
|
||||
$limit,
|
||||
$this->adminInfo ?? null,
|
||||
$request->input('dept_id')
|
||||
);
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
@@ -61,8 +69,10 @@ class DiceRewardController extends BaseController
|
||||
if (!in_array($direction, [DiceReward::DIRECTION_CLOCKWISE, DiceReward::DIRECTION_COUNTERCLOCKWISE], true)) {
|
||||
$direction = DiceReward::DIRECTION_CLOCKWISE;
|
||||
}
|
||||
$deptId = AdminScopeHelper::resolveConfigDeptId($this->adminInfo ?? null, $request->input('dept_id'));
|
||||
DiceReward::refreshCache($deptId);
|
||||
$logic = new DiceRewardLogic();
|
||||
$data = $logic->getListGroupedByTierForDirection($direction);
|
||||
$data = $logic->getListGroupedByTierForDirection($direction, $deptId);
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
@@ -74,9 +84,10 @@ class DiceRewardController extends BaseController
|
||||
#[Permission('奖励对照列表', 'dice:reward:index:index')]
|
||||
public function weightRatioListWithDirection(Request $request): Response
|
||||
{
|
||||
DiceReward::refreshCache();
|
||||
$deptId = AdminScopeHelper::resolveConfigDeptId($this->adminInfo ?? null, $request->input('dept_id'));
|
||||
DiceReward::refreshCache($deptId);
|
||||
$logic = new DiceRewardLogic();
|
||||
$data = $logic->getListGroupedByTierWithDirection();
|
||||
$data = $logic->getListGroupedByTierWithDirection($deptId);
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
@@ -103,11 +114,14 @@ class DiceRewardController extends BaseController
|
||||
'chain_free_mode' => $post['chain_free_mode'] ?? null,
|
||||
'kill_mode_enabled' => $post['kill_mode_enabled'] ?? null,
|
||||
'test_safety_line' => $post['test_safety_line'] ?? null,
|
||||
'dept_id' => $post['dept_id'] ?? null,
|
||||
'ante_config_id' => $post['ante_config_id'] ?? null,
|
||||
];
|
||||
$adminId = isset($this->adminInfo['id']) ? (int) $this->adminInfo['id'] : null;
|
||||
$requestDeptId = AdminScopeHelper::pickRequestDeptId($request->input('dept_id'), $post);
|
||||
try {
|
||||
$logic = new DiceRewardConfigRecordLogic();
|
||||
$recordId = $logic->createWeightTestRecord($params, $adminId);
|
||||
$recordId = $logic->createWeightTestRecord($params, $adminId, $this->adminInfo ?? null, $requestDeptId);
|
||||
return $this->success(['record_id' => $recordId]);
|
||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
@@ -167,8 +181,9 @@ class DiceRewardController extends BaseController
|
||||
return $this->fail('parameter items must be an array');
|
||||
}
|
||||
try {
|
||||
$deptId = AdminScopeHelper::resolveConfigDeptId($this->adminInfo ?? null, $request->input('dept_id'));
|
||||
$logic = new DiceRewardLogic();
|
||||
$logic->batchUpdateWeights($items);
|
||||
$logic->batchUpdateWeights($items, $deptId);
|
||||
return $this->success('save success');
|
||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
@@ -191,8 +206,9 @@ class DiceRewardController extends BaseController
|
||||
return $this->fail('parameter items must be an array');
|
||||
}
|
||||
try {
|
||||
$deptId = AdminScopeHelper::resolveConfigDeptId($this->adminInfo ?? null, $request->input('dept_id'));
|
||||
$logic = new DiceRewardLogic();
|
||||
$logic->batchUpdateWeightsByDirection($direction, $items);
|
||||
$logic->batchUpdateWeightsByDirection($direction, $items, $deptId);
|
||||
return $this->success('save success');
|
||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user