| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682 |
- <?php
- namespace App\Http\Controllers\Admin;
- use App\Http\helper\Helper;
- use App\Http\helper\NumConfig;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- class ExtensionController
- {
- // -----------------------------------------------------------------------邀请注册------------------------------------------------------------------------------
- // 推广奖金审核
- public function verify(Request $request)
- {
- $NickName = $request->NickName ?: '';
- $GameID = $request->GameID ?: '';
- $mobile = $request->mobile ?: '';
- $SpreaderID = $request->SpreaderID ?: '';
- $start_time = $request->start_time ?: '';
- $end_time = $request->end_time ?: '';
- $Type = $request->Type ?: '';
- $Sort = $request->Sort ?: '';
- $FinalScoreSort = $request->FinalScoreSort ?: '';
- if (!empty($SpreaderID)) {
- $getSpreaderID = DB::connection('read')->table('QPAccountsDB.dbo.AccountsInfo ')
- ->where('GameID', $SpreaderID)
- ->select('UserID')
- ->first()->UserID ?? '';
- }
- $where = [];
- !empty($NickName) && $where[] = ['ai.NickName', 'like', $NickName . '%'];
- !empty($GameID) && $where[] = ['ai.GameID', $GameID];
- !empty($getSpreaderID) && $where[] = ['ai.SpreaderID', $getSpreaderID];
- !empty($start_time) && $where[] = ['ai.RegisterDate', '>=', $start_time];
- !empty($end_time) && $where[] = ['ai.RegisterDate', '<=', $end_time];
- if (!empty($mobile)) {
- $PhoneNum = DB::connection('read')->table('QPAccountsDB.dbo.AccountPhone')
- ->where('PhoneNum', $mobile)
- ->pluck('UserID')->toArray();
- if (!empty($PhoneNum)) {
- $where[] = [function ($where) use ($PhoneNum) {
- $where->whereIn('vy.UserID', $PhoneNum);
- }];
- }
- }
- if (!empty($Type)) {
- $TypeData = explode(',', trim($Type, ','));
- if (!empty($TypeData)) {
- $where[] = [function ($where) use ($TypeData) {
- $where->whereIn('vy.Type', $TypeData);
- }];
- }
- }
- // 审核可见金额
- $visibleAmount = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'VerifyScore')
- ->first();
- $UpperLimit = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'UpperLimit')
- ->first();
- // 自动审核开关
- $AutoVerify = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'AutoVerify')
- ->value('StatusValue');
- $where[] = ['TotalScore', '>=', $visibleAmount->StatusValue];
- $where[] = ['Status', 0];
- $field = ['vy.Remarks', 'vy.ReceivedScore', 'vy.OverLook', 'vy.id', 'ua.UserID', 'Higher1ID', 'Higher2ID', 'downCount1', 'downCount2', 'ai.GameID', 'ai.RegisterDate', 'FinalScore', 'TotalScore', 'vy.Type', 'ai.SpreaderID'];
- $SQL = DB::connection('write')->table('agent.dbo.extension_verify as vy')
- ->join('QPAccountsDB.dbo.AccountsInfo as ai', 'vy.UserID', 'ai.UserID')
- ->join('QPAccountsDB.dbo.UserAgent as ua', 'vy.UserID', 'ua.UserID')
- ->where($where)
- ->select($field)
- ->orderBy('OverLook', 'asc');
- // 历史通过审核金排序
- if (!empty($FinalScoreSort)) {
- $SQL = $SQL->orderBy("FinalScore", $FinalScoreSort);
- }
- // 待审金额排序
- if (!empty($Sort)) {
- $SQL = $SQL->orderBy("TotalScore", $Sort);
- }
- // 待审金额 默认排序 倒叙
- if (empty($Sort) && empty($FinalScoreSort)) {
- $SQL = $SQL->orderBy("TotalScore", 'desc');
- }
- $list = $SQL->paginate(10);
- $UserIDs = [];
- $SpreaderIDs = [];
- foreach ($list as $v) {
- $UserIDs[] = $v->UserID;
- $SpreaderIDs[] = $v->SpreaderID;
- }
- // 获取上级ID 'ai1.GameID as SpreaderID'
- $getSpreaderID = DB::connection('read')->table('QPAccountsDB.dbo.AccountsInfo')
- ->whereIn('UserID', $SpreaderIDs)
- ->select('GameID', 'UserID')
- ->pluck('GameID', 'UserID')->toArray();
- // 获取来源人数
- $user_profit_log = DB::connection('write')->table('agent.dbo.extension_user_profit_log')
- ->where('OrderID', 0)
- ->whereIn('UserID', $UserIDs)
- ->selectRaw('IsNull(sum(NoteCount),0) NoteCount,UserID,Type')
- ->where('Status', 1)
- ->groupBy('UserID', 'Type')
- ->get();
- foreach ($user_profit_log as &$value) {
- $InvitationUserIDs = DB::connection('write')->table('agent.dbo.extension_user_profit_log')
- ->where('UserID', $value->UserID)
- ->where('Status', 1)
- ->where('OrderID', 0)
- ->where('Type', $value->Type)
- ->select('InvitationUserIDs')
- ->pluck('InvitationUserIDs')->toArray();
- $value->InvitationUserIDs = implode(',', $InvitationUserIDs);
- }
- unset($value);
- $rewards = DB::connection('read')->table('QPRecordDB.dbo.RecordUserScoreStatisticsNew')
- ->where('ScoreType', 36)
- ->whereIn('UserID', $UserIDs)
- ->selectRaw('sum(Score) Score,UserID')
- ->groupBy('UserID')
- ->pluck('Score', 'UserID')->toArray();
- $service = new Extension();
- foreach ($list as &$value) {
- $value->count = $value->rechargeCount = $value->RechargeSum = 0;
- $value->TotalScore = number_float($value->TotalScore / NumConfig::NUM_VALUE);
- $value->ReceivedScore = number_float($value->ReceivedScore / NumConfig::NUM_VALUE);
- $value->SpreaderID = isset($getSpreaderID[$value->SpreaderID]) ? $getSpreaderID[$value->SpreaderID] : '';
- // 来源人数,充值金额,充值人数
- $service->sourcePlayer($user_profit_log, $value);
- $reward = isset($rewards[$value->UserID]) ? $rewards[$value->UserID] : 0;
- $TotalReward1 = DB::connection('read')->table('QPAccountsDB.dbo.UserAgent')
- ->where('Higher1ID', $value->UserID)
- ->selectRaw('IsNull(sum(TotalReward1),0) TotalReward')
- ->first()->TotalReward ?? 0;
- $TotalReward2 = DB::connection('read')->table('QPAccountsDB.dbo.UserAgent')
- ->Where('Higher2ID', $value->UserID)
- ->selectRaw('IsNull(sum(TotalReward2),0) TotalReward')
- ->first()->TotalReward ?? 0;
- $value->Total = number_float(($reward + $TotalReward1 + $TotalReward2 + $value->FinalScore) / NumConfig::NUM_VALUE);
- $value->FinalScore = number_float($value->FinalScore / NumConfig::NUM_VALUE);
- }
- unset($value);
- $visibleAmount->StatusValue /= NumConfig::NUM_VALUE;
- $UpperLimit->StatusValue /= NumConfig::NUM_VALUE;
- $start_time = Helper::timeChange($start_time);
- $end_time = Helper::timeChange($end_time);
- $data = compact('list', 'GameID', 'SpreaderID', 'start_time', 'end_time', 'mobile', 'NickName', 'Type', 'visibleAmount', 'Sort', 'UpperLimit', 'FinalScoreSort', 'AutoVerify');
- return view('admin.extension.verify', $data);
- }
- // 推广奖金审核 -- 修改状态
- public function verify_update(Request $request, $id)
- {
- $field = $request->field;
- $value = $request->value;
- $UserID = $request->UserID;
- $TotalScore = $request->TotalScore;
- $data[$field] = $value;
- if ($field == 'Status') {
- $first = DB::connection('write')->table('agent.dbo.extension_verify')
- ->where('id', $id)
- ->first();
- // 添加记录
- DB::connection('write')->table('agent.dbo.extension_verify_log')
- ->insert([
- 'UserID' => $UserID,
- 'AgreeScore' => $TotalScore * NumConfig::NUM_VALUE,
- 'CreateTime' => date('Y-m-d H:i:s'),
- 'Remarks' => $first->Remarks,
- 'Type' => $first->Type,
- ]);
- $data['Remarks'] = '';
- }
- DB::connection('write')->table('agent.dbo.extension_verify')
- ->where('id', $id)
- ->update($data);
- return apiReturnSuc();
- }
- // 注册奖金配置
- public function register_config()
- {
- $list = DB::connection('write')->table('agent.dbo.extension_config')
- ->where('type', 1)
- ->paginate(10);
- foreach ($list as &$value) {
- foreach ($value as $key => &$val) {
- if ($key != 'id' && $key != 'name' && $key != 'level_quota_number' && $key != 'two_level_quota_number') {
- $val /= NumConfig::NUM_VALUE;
- }
- }
- }
- return view('admin.extension.register_config', compact('list'));
- }
- // 注册奖金配置 -- 添加
- public function register_config_add(Request $request)
- {
- if ($request->isMethod('post')) {
- $post = $request->post();
- foreach ($post as $key => &$value) {
- if ($key != 'name' && $key != 'level_quota_number' && $key != 'two_level_quota_number') {
- $value *= NumConfig::NUM_VALUE;
- }
- }
- DB::connection('write')->table('agent.dbo.extension_config')->insert($post);
- return apiReturnSuc();
- }
- return view('admin.extension.register_config_add');
- }
- // 注册奖金配置 -- 修改
- public function register_config_update(Request $request, $id)
- {
- if ($request->isMethod('post')) {
- $post = $request->post();
- foreach ($post as $key => &$value) {
- if ($key != 'name' && $key != 'level_quota_number' && $key != 'two_level_quota_number') {
- $value *= NumConfig::NUM_VALUE;
- }
- }
- DB::connection('write')->table('agent.dbo.extension_config')
- ->where('id', $id)
- ->update($post);
- return apiReturnSuc();
- }
- $info = DB::connection('write')->table('agent.dbo.extension_config')
- ->where('id', $id)
- ->first();
- foreach ($info as $key => &$value) {
- if ($key != 'id' && $key != 'name' && $key != 'level_quota_number' && $key != 'two_level_quota_number') {
- $value /= NumConfig::NUM_VALUE;
- }
- }
- return view('admin.extension.register_config_update', compact('info'));
- }
- // 裂变可领额度上限配置
- public function upperLimit(Request $request)
- {
- if ($request->isMethod('post')) {
- $post = $request->post();
- $post['StatusValue'] *= NumConfig::NUM_VALUE;
- DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'UpperLimit')
- ->update($post);
- return apiReturnSuc();
- }
- $info = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'UpperLimit')
- ->first();
- $info->StatusValue /= NumConfig::NUM_VALUE;
- return view('admin.extension.upper_limit', compact('info'));
- }
- // 审核可见分数修改
- public function verifyScore(Request $request)
- {
- if ($request->isMethod('post')) {
- $post = $request->post();
- $post['StatusValue'] *= NumConfig::NUM_VALUE;
- DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'VerifyScore')
- ->update($post);
- return apiReturnSuc();
- }
- $info = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'VerifyScore')
- ->first();
- $info->StatusValue /= NumConfig::NUM_VALUE;
- return view('admin.extension.verify_score', compact('info'));
- }
- // 待审核页面的备注
- public function verifyRemarks(Request $request, $UserID)
- {
- $post = $request->post();
- DB::connection('write')->table('agent.dbo.extension_verify')
- ->where('UserID', $UserID)
- ->update($post);
- return apiReturnSuc();
- }
- // 奖励来源
- public function userSource(Request $request)
- {
- $UserID = $request->UserID ?: '';
- $Type = $request->Type ?: '';
- $GameID = $request->GameID ?: '';
- $OrderID = $request->OrderID ?: 0;
- if (!empty($OrderID) || $OrderID === 0) {
- $list = DB::connection('write')->table('agent.dbo.extension_user_profit_log')
- ->where('OrderID', $OrderID)
- ->where('UserID', $UserID)
- ->where('Type', $Type)
- ->where('Status', 1)
- ->paginate(10);
- } else {
- $list = DB::connection('write')->table('agent.dbo.extension_user_profit_log')
- ->where('UserID', $UserID)
- ->where('Type', $Type)
- ->where('OrderID', 0)
- ->where('Status', 1)
- ->paginate(10);
- }
- foreach ($list as &$value) {
- $value->toGold /= NumConfig::NUM_VALUE;
- }
- unset($value);
- return view('admin.extension.user_source', compact('list', 'UserID', 'Type', 'GameID'));
- }
- // 审核通过列表
- public function verifyFinal(Request $request)
- {
- $NickName = $request->NickName ?: '';
- $GameID = $request->GameID ?: '';
- $mobile = $request->mobile ?: '';
- $SpreaderID = $request->SpreaderID ?: '';
- $start_time = $request->start_time ?: '';
- $end_time = $request->end_time ?: '';
- $Type = $request->Type ?: '';
- $Sort = $request->Sort ?: '';
- $CreateTimeStart = $request->CreateTimeStart ?: '';
- $CreateTimeEnd = $request->CreateTimeEnd ?: '';
- if (!empty($SpreaderID)) {
- $getSpreaderID = DB::connection('read')->table('QPAccountsDB.dbo.AccountsInfo ')
- ->where('GameID', $SpreaderID)
- ->select('UserID')
- ->first()->UserID ?? '';
- }
- $where = [];
- !empty($NickName) && $where[] = ['ai.NickName', 'like', $NickName . '%'];
- !empty($GameID) && $where[] = ['ai.GameID', $GameID];
- !empty($getSpreaderID) && $where[] = ['ai.SpreaderID', $getSpreaderID];
- !empty($start_time) && $where[] = ['ai.RegisterDate', '>=', $start_time];
- !empty($end_time) && $where[] = ['ai.RegisterDate', '<=', $end_time];
- !empty($CreateTimeStart) && $where[] = ['log.CreateTime', '>=', $CreateTimeStart];
- !empty($CreateTimeEnd) && $where[] = ['log.CreateTime', '<=', $CreateTimeEnd];
- !empty($Type) && $where[] = ['vy.Type', $Type];
- if (!empty($mobile)) {
- $PhoneNum = DB::connection('read')->table('QPAccountsDB.dbo.AccountPhone')
- ->where('PhoneNum', $mobile)
- ->pluck('UserID')->toArray();
- if (!empty($PhoneNum)) {
- $where[] = [function ($where) use ($PhoneNum) {
- $where->whereIn('vy.UserID', $PhoneNum);
- }];
- }
- }
- // 审核可见金额
- $visibleAmount = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'VerifyScore')
- ->first();
- $UpperLimit = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'UpperLimit')
- ->first();
- $field = ['log.id', 'log.OrderID', 'log.CreateTime', 'log.UpdateTime', 'log.Remarks', 'AgreeScore', 'log.FinalScore as logFinalScore', 'vy.ReceivedScore', 'vy.OverLook', 'ua.UserID', 'Higher1ID', 'Higher2ID', 'downCount1', 'downCount2', 'ai.GameID', 'ai.RegisterDate', 'vy.FinalScore', 'TotalScore', 'log.Type', 'ai.SpreaderID'];
- $SQL = DB::connection('write')->table('agent.dbo.extension_verify_log as log')
- ->join('QPAccountsDB.dbo.AccountsInfo as ai', 'log.UserID', 'ai.UserID')
- ->leftjoin('agent.dbo.extension_verify as vy', function ($join) {
- $join->on('log.UserID', 'vy.UserID')->on('log.Type', 'vy.Type');
- })
- ->join('QPAccountsDB.dbo.UserAgent as ua', 'log.UserID', 'ua.UserID')
- ->where($where)
- ->select($field)
- ->orderBy('CreateTime', 'desc');
- if (!empty($Sort)) {
- $list = $SQL->orderBy("TotalScore", $Sort)->paginate(10);
- } else {
- $list = $SQL->orderBy('TotalScore', 'desc')->paginate(10);
- }
- $OrderIDs = [];
- $SpreaderIDs = [];
- $UserIDs = [];
- foreach ($list as $v) {
- $OrderIDs[] = $v->OrderID;
- $SpreaderIDs[] = $v->SpreaderID;
- $UserIDs[] = $v->UserID;
- }
- // 获取上级ID 'ai1.GameID as SpreaderID'
- $getSpreaderID = DB::connection('read')->table('QPAccountsDB.dbo.AccountsInfo')
- ->whereIn('UserID', $SpreaderIDs)
- ->select('GameID', 'UserID')
- ->pluck('GameID', 'UserID')->toArray();
- $user_profit_log = DB::connection('write')->table('agent.dbo.extension_user_profit_log')
- ->whereIn('OrderID', $OrderIDs)
- ->whereIn('UserID', $UserIDs)
- ->selectRaw('IsNull(sum(NoteCount),0) NoteCount,OrderID,UserID,Type')
- ->groupBy('OrderID', 'UserID', 'Type')
- ->get();
- $user_profit_log1 = DB::connection('write')->table('agent.dbo.extension_user_profit_log')
- ->whereIn('OrderID', $OrderIDs)
- ->whereIn('UserID', $UserIDs)
- ->selectRaw('count(distinct(InvitationUserIDs)) NoteCount,OrderID')
- ->groupBy('OrderID')
- ->pluck('NoteCount', 'OrderID')->toArray();
- foreach ($list as &$value) {
- $value->count = 0;
- $value->TotalScore = number_float($value->TotalScore / NumConfig::NUM_VALUE);
- $value->ReceivedScore = number_float($value->ReceivedScore / NumConfig::NUM_VALUE);
- $value->logFinalScore = !empty($value->logFinalScore) ? number_float($value->logFinalScore / NumConfig::NUM_VALUE) : '';
- $value->AgreeScore = number_float($value->AgreeScore / NumConfig::NUM_VALUE);
- // 来源人数
- if ($value->Type == 1) {
- foreach ($user_profit_log as $val) {
- if ($val->UserID == $value->UserID && $val->Type == $value->Type) {
- $value->count = $val->NoteCount;
- }
- }
- } else {
- $value->count = isset($user_profit_log1[$value->OrderID]) ? $user_profit_log1[$value->OrderID] : 0;
- }
- $value->SpreaderID = isset($getSpreaderID[$value->SpreaderID]) ? $getSpreaderID[$value->SpreaderID] : '';
- $reward = DB::connection('read')->table('QPRecordDB.dbo.RecordUserScoreStatisticsNew')
- ->where('ScoreType', 36)
- ->where('UserID', $value->UserID)
- ->selectRaw('sum(Score) Score')
- ->first()->Score ?? 0;
- $TotalReward1 = DB::connection('read')->table('QPAccountsDB.dbo.UserAgent')
- ->where('Higher1ID', $value->UserID)
- ->selectRaw('IsNull(sum(TotalReward1),0) TotalReward')
- ->first()->TotalReward ?? 0;
- $TotalReward2 = DB::connection('read')->table('QPAccountsDB.dbo.UserAgent')
- ->Where('Higher2ID', $value->UserID)
- ->selectRaw('IsNull(sum(TotalReward2),0) TotalReward')
- ->first()->TotalReward ?? 0;
- $value->Total = number_float(($reward + $TotalReward1 + $TotalReward2 + $value->FinalScore) / NumConfig::NUM_VALUE);
- $value->FinalScore = number_float($value->FinalScore / NumConfig::NUM_VALUE);
- }
- $visibleAmount->StatusValue /= NumConfig::NUM_VALUE;
- $UpperLimit->StatusValue /= NumConfig::NUM_VALUE;
- $start_time = Helper::timeChange($start_time);
- $end_time = Helper::timeChange($end_time);
- $CreateTimeStart = Helper::timeChange($CreateTimeStart);
- $CreateTimeEnd = Helper::timeChange($CreateTimeEnd);
- $data = compact('list', 'GameID', 'SpreaderID', 'start_time', 'end_time', 'mobile', 'NickName', 'Type', 'visibleAmount', 'Sort', 'UpperLimit', 'CreateTimeStart', 'CreateTimeEnd');
- return view('admin.extension.verify_final', $data);
- }
- // 审核通过列表页面的备注
- public function verifyFinalRemarks(Request $request, $ID)
- {
- $post = $request->post();
- DB::connection('write')->table('agent.dbo.extension_verify_log')
- ->where('id', $ID)
- ->update($post);
- return apiReturnSuc();
- }
- // -----------------------------------------------------------------------游戏对局------------------------------------------------------------------------------
- // 游戏对局 ---- 配置
- public function gameCountConfig(Request $request)
- {
- $list = DB::connection('write')->table('agent.dbo.extension_config')
- ->where('type', 2)
- ->paginate(10);
- foreach ($list as &$value) {
- foreach ($value as $key => &$val) {
- if ($key != 'id' && $key != 'name' && $key != 'level_quota_number' && $key != 'two_level_quota_number') {
- $val /= NumConfig::NUM_VALUE;
- }
- }
- }
- return view('admin.extension.gamecount_config', compact('list'));
- }
- // 注册奖金配置 -- 添加
- public function gameCountConfig_add(Request $request)
- {
- if ($request->isMethod('post')) {
- $post = $request->post();
- foreach ($post as $key => &$value) {
- if ($key != 'name' && $key != 'level_quota_number' && $key != 'two_level_quota_number') {
- $value *= NumConfig::NUM_VALUE;
- }
- }
- $post['type'] = 2;
- DB::connection('write')->table('agent.dbo.extension_config')->insert($post);
- return apiReturnSuc();
- }
- return view('admin.extension.gamecount_config_add');
- }
- // 注册奖金配置 -- 修改
- public function gameCountConfig_update(Request $request, $id)
- {
- if ($request->isMethod('post')) {
- $post = $request->post();
- foreach ($post as $key => &$value) {
- if ($key != 'name' && $key != 'level_quota_number' && $key != 'two_level_quota_number') {
- $value *= NumConfig::NUM_VALUE;
- }
- }
- DB::connection('write')->table('agent.dbo.extension_config')
- ->where('id', $id)
- ->update($post);
- return apiReturnSuc();
- }
- $info = DB::connection('write')->table('agent.dbo.extension_config')
- ->where('id', $id)
- ->first();
- foreach ($info as $key => &$value) {
- if ($key != 'id' && $key != 'name' && $key != 'level_quota_number' && $key != 'two_level_quota_number') {
- $value /= NumConfig::NUM_VALUE;
- }
- }
- return view('admin.extension.gamecount_config_update', compact('info'));
- }
- // 裂变可领额度上限配置
- public function gameCountLimit(Request $request)
- {
- if ($request->isMethod('post')) {
- $post = $request->post();
- $post['StatusValue'] *= NumConfig::NUM_VALUE;
- DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'GameCountLimit')
- ->update($post);
- return apiReturnSuc();
- }
- $info = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'GameCountLimit')
- ->first();
- $info->StatusValue /= NumConfig::NUM_VALUE;
- return view('admin.extension.gamecount_limit', compact('info'));
- }
- // 自动审核开关
- public function autoVerify(Request $request)
- {
- $StatusValue = $request->StatusValue;
- DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'AutoVerify')
- ->update(['StatusValue' => $StatusValue]);
- return apiReturnSuc();
- }
- public function recharge_rate(Request $request)
- {
- if ($request->isMethod('post')) {
- $post = $request->post();
- if (is_array($post)) {
- foreach ($post as $key => $value) {
- DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', $key)
- ->update(['StatusValue' => $value * NumConfig::NUM_VALUE]);
- }
- }
- return apiReturnSuc();
- }
- $list = DB::connection('write')->table('QPAccountsDB.dbo.SystemStatusInfo')
- ->where('StatusName', 'AgentRebateRatio1')
- ->orWhere('StatusName', 'AgentRebateRatio2')
- ->get();
- return view('admin.extension.recharge_rate',compact('list'));
- }
- }
|