|
|
@@ -1179,39 +1179,25 @@ class GlobalController extends Controller
|
|
|
}
|
|
|
|
|
|
|
|
|
- //用户单控系统-详细用户列表 修改
|
|
|
+ //用户单控系统-详细用户列表 修改(简化版:只控制金额和整体概率)
|
|
|
public function dk_userlist_edit(Request $request)
|
|
|
{
|
|
|
$UserID = $request->UserID ?? '';
|
|
|
- $TempID = $request->TempID ?? '';
|
|
|
-
|
|
|
- $ControlModel = new Control();
|
|
|
$build_sql = DB::connection('write')->table('QPTreasureDB.dbo.UserScoreControl');
|
|
|
|
|
|
if ($request->isMethod('post')) {
|
|
|
|
|
|
$post = $request->post();
|
|
|
|
|
|
- if (!empty($post['Template'])) {
|
|
|
- $cc=new ControlController();
|
|
|
- $Template=(array)$cc->getConfigByID($post['Template']);
|
|
|
- $post = array_merge($Template, $post);
|
|
|
- }
|
|
|
-
|
|
|
+ $ControlScore = (float)($post['ControlScore'] ?? 0);
|
|
|
+ $Probability = (float)($post['Probability'] ?? 0);
|
|
|
+ $Remarks = $post['Remarks'] ?? '';
|
|
|
|
|
|
-// if (!empty($post['TPBai']) && empty($post['TpBaiGear'])) {
|
|
|
-// return apiReturnFail('TP百人额度未设置');
|
|
|
-// }
|
|
|
-// if (!empty($post['ABBai']) && empty($post['ABBaiGear'])) {
|
|
|
-// return apiReturnFail('A&B额度未设置');
|
|
|
-// }
|
|
|
-// if (empty($post['Template']) && empty($post['TP']) && empty($post['TPAK47']) && empty($post['TPJOKER']) && empty($post['Rummy5']) && empty($post['Rummy2'])) {
|
|
|
-// return apiReturnFail('概率没有配置,无法提交!');
|
|
|
-// }
|
|
|
- DB::connection('write')->table('QPTreasureDB.dbo.UserControlServer')->where('UserID', $UserID)->delete();
|
|
|
+ // 概率范围 0-100
|
|
|
+ if ($Probability < 0 || $Probability > 100) {
|
|
|
+ return apiReturnFail('概率必须在0-100之间');
|
|
|
+ }
|
|
|
|
|
|
- $ControlScore = $post['ControlScore'];
|
|
|
- $Remarks = $post['Remarks'];
|
|
|
$admin_id = session('admin')->id;
|
|
|
$admin_user = DB::connection('read')->table('agent.dbo.admin_users')->where('id', $admin_id)->first();
|
|
|
/*管理员彩金控制*/
|
|
|
@@ -1220,37 +1206,21 @@ class GlobalController extends Controller
|
|
|
AdminScore::add_score($admin_user, abs($ControlScore), 2);
|
|
|
}
|
|
|
|
|
|
- /*用户单控记录添加*/
|
|
|
- $GameData = (new Control())->GameData;
|
|
|
- foreach ($post as $key => &$value) {
|
|
|
- if ($key == 'ABBaiGear') {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (!isset($GameData[$key])) {
|
|
|
- unset($post[$key]);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 控制分数
|
|
|
+ // 记录单控操作(只记金额和总体概率)
|
|
|
$prefix = $ControlScore < 0 ? '输' : '赢';
|
|
|
- // 概率
|
|
|
- $str = '';
|
|
|
- foreach ($post as $key => $value) {
|
|
|
- $str .= $key . ':' . number_float($value) . '% ,';
|
|
|
- }
|
|
|
- $content = $prefix . $ControlScore . '/' . rtrim($str, ',');
|
|
|
+ $content = $prefix . $ControlScore . '/ 概率:' . number_float($Probability) . '%';
|
|
|
$score = DB::connection('read')->table('QPTreasureDB.dbo.GameScoreInfo')->where('UserID', $UserID)->select('Score')->first()->Score ?? 0;
|
|
|
ControlRecord::record_add($UserID, $admin_id, $content, $score);
|
|
|
- // 用户控制游戏和场次
|
|
|
- $ControlModel->userControl($post, $UserID);
|
|
|
+
|
|
|
$data = [
|
|
|
'ControlScore' => (int)($ControlScore * NumConfig::NUM_VALUE),
|
|
|
'EffectiveScore' => 0,
|
|
|
'ControlKindID' => -1,
|
|
|
'Remarks' => $Remarks,
|
|
|
'InsertDate' => date('Y-m-d H:i:s'),
|
|
|
- 'ControlRadian' => 0,
|
|
|
- 'UserID'=>$UserID
|
|
|
+ // 概率直接写入 ControlRadian,不再区分游戏
|
|
|
+ 'ControlRadian' => $Probability,
|
|
|
+ 'UserID' => $UserID
|
|
|
];
|
|
|
|
|
|
$build_sql->updateOrInsert(['UserID' => $UserID], $data);
|
|
|
@@ -1263,59 +1233,13 @@ class GlobalController extends Controller
|
|
|
return $this->json(200, "修改成功");
|
|
|
}
|
|
|
|
|
|
- $ControlScore = $build_sql->where('UserID', $UserID)->first()->ControlScore ?? '0';
|
|
|
-
|
|
|
- $GameKindItem = DB::connection('read')->table('QPPlatformDB.dbo.GameKindItem')->pluck('KindID')->toArray();
|
|
|
-
|
|
|
- $UserControlKind = DB::connection('write')->table('QPTreasureDB.dbo.UserControlKind')
|
|
|
- ->where('UserID', $UserID)
|
|
|
- ->selectRaw('(ControlRadian) ControlRadian,KindID')
|
|
|
- ->pluck('ControlRadian', 'KindID')->toArray();
|
|
|
-
|
|
|
- $GameData = array_flip($ControlModel->GameData);
|
|
|
-
|
|
|
-
|
|
|
- foreach ($GameKindItem as $value) {
|
|
|
- if (!empty($GameData[$value] ?? '')) $UserControlKind[$GameData[$value]] = $UserControlKind[$value] ?? '';
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-// $TPBai = $UserControlKind['TPBai'];
|
|
|
-// $ABBai = $UserControlKind['ABBai'];
|
|
|
-
|
|
|
-// $substr = substr($TPBai, -3);
|
|
|
-// $UserControlKind['TPBai'] = (int)$substr;
|
|
|
-// $UserControlKind['TPBaiGear'] = !empty($TPBai) ? ($TPBai - $substr) / 1000 : '';
|
|
|
-
|
|
|
-// $substr = substr($ABBai, -3);
|
|
|
-// $UserControlKind['ABBai'] = (int)$substr;
|
|
|
-// $UserControlKind['ABBaiGear'] = !empty($ABBai) ? ($ABBai - $substr) / 1000 : '';
|
|
|
-
|
|
|
- $amount = DB::connection('write')->table('agent.dbo.order')
|
|
|
- ->where('user_id', $UserID)
|
|
|
- ->where('pay_status', 1)
|
|
|
- ->orderByDesc('pay_at')
|
|
|
- ->first()->amount ?? '';
|
|
|
-
|
|
|
-
|
|
|
- !empty($amount) && $amount = (int)($amount / 100);
|
|
|
-// $ControlScore = empty($ControlScore) ? $amount : $ControlScore / NumConfig::NUM_VALUE;
|
|
|
- $ControlScore = $ControlScore / NumConfig::NUM_VALUE;
|
|
|
-
|
|
|
-
|
|
|
-// $list = DB::connection('write')->table('agent.dbo.ControlConfig')->get();
|
|
|
- $cc=new ControlController();
|
|
|
- $list=$cc->getList();
|
|
|
-
|
|
|
-
|
|
|
-// $TpBaiGear = DB::connection('write')->table('agent.dbo.ControlGear')->where('KindID', 2010)->get();
|
|
|
- $ABBai = DB::connection('write')->table('agent.dbo.ControlGear')->where('KindID', 2012)->get();
|
|
|
-
|
|
|
- $ControlModel = new Control();
|
|
|
+ $row = $build_sql->where('UserID', $UserID)->first();
|
|
|
+ $ControlScore = $row->ControlScore ?? 0;
|
|
|
+ $Probability = $row->ControlRadian ?? 0;
|
|
|
|
|
|
- $GameDataText=$ControlModel->GameDataText;
|
|
|
+ $ControlScore = $ControlScore / NumConfig::NUM_VALUE;
|
|
|
|
|
|
- $data = compact('UserID', 'UserControlKind', 'ControlScore', 'list', 'TempID', 'ABBai','GameDataText');
|
|
|
+ $data = compact('UserID', 'ControlScore', 'Probability');
|
|
|
|
|
|
return view('admin.global.dk_userlist_edit', $data);
|
|
|
|