From 170895055ed01f2173fa29305a6251e36bb4cae1 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 6 Jan 2021 14:45:56 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=87=8D=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/FinancialSummaryController.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/FinancialSummaryController.class.php b/Application/Admin/Controller/FinancialSummaryController.class.php index 5c64eec11..b75b0de48 100644 --- a/Application/Admin/Controller/FinancialSummaryController.class.php +++ b/Application/Admin/Controller/FinancialSummaryController.class.php @@ -43,7 +43,8 @@ class FinancialSummaryController extends AdminController } public function updateStatement() { - $temp = date('Y',time()).'-'.(date('m',time())-1); + + $temp = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')); $params = "php ".SUBSITE_INDEX." FinancialSummarySet/setMonthFinancialSummary/recount/1/count_date/{$temp}"; $r = D("CmdTasks")->addTask("FinancialSummary",$params); if($r){ From 3dfc92ecc39c1a0e650749903048ad57269daff4 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 6 Jan 2021 15:29:25 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Repository/SpendRepository.class.php | 14 +++++++------- .../Home/Controller/QueryController.class.php | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Application/Base/Repository/SpendRepository.class.php b/Application/Base/Repository/SpendRepository.class.php index 1421a45e7..4451eef2c 100644 --- a/Application/Base/Repository/SpendRepository.class.php +++ b/Application/Base/Repository/SpendRepository.class.php @@ -177,7 +177,7 @@ class SpendRepository $gameIds = $params['game_ids'] ?? []; $conditions = $this->getGameGroupConditionsNew($params); $field = 'game_id, sum(pay_amount) as amount'; - $items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); + $items = M('spend use index(spend_search)', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); return $this->assembleRecords($items, $gameIds, 'amount', 'game_id'); } @@ -187,7 +187,7 @@ class SpendRepository public function getPayAmountByGameAndType($params) { $conditions = $this->getGameGroupConditionsNew($params); - return M('spend', 'tab_')->where($conditions)->sum('pay_amount'); + return M('spend use index(spend_search)', 'tab_')->where($conditions)->sum('pay_amount'); } /** @@ -234,7 +234,7 @@ class SpendRepository $gameIds = $params['game_ids'] ?? []; $conditions = $this->getGameGroupConditions($params); $field = 'game_id, count(*) count'; - $items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); + $items = M('spend use index(spend_search)', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); return $this->assembleRecords($items, $gameIds, 'count', 'game_id'); } @@ -244,7 +244,7 @@ class SpendRepository public function getPayCountByGame($params) { $conditions = $this->getGameGroupConditions($params); - return M('spend', 'tab_')->where($conditions)->count(); + return M('spend use index(spend_search)', 'tab_')->where($conditions)->count(); } /** @@ -255,7 +255,7 @@ class SpendRepository $gameIds = $params['game_ids'] ?? []; $conditions = $this->getGameGroupConditions($params); $field = 'game_id, count(distinct user_id) count'; - $items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); + $items = M('spend use index(spend_search)', 'tab_')->field($field)->where($conditions)->group('game_id')->select(); return $this->assembleRecords($items, $gameIds, 'count', 'game_id'); } @@ -265,7 +265,7 @@ class SpendRepository public function getPayUserCountByGame($params) { $conditions = $this->getGameGroupConditions($params); - $sql = M('spend', 'tab_')->field('distinct game_id, user_id') + $sql = M('spend use index(spend_search)', 'tab_')->field('distinct game_id, user_id') ->where($conditions) ->fetchSql(true) ->select(); @@ -307,7 +307,7 @@ class SpendRepository $oldConditions['pay_time'] = ['lt', $beginTime]; $oldQuery = M('spend', 'tab_')->field('user_id')->where($oldConditions)->group('user_id')->buildSql(); $conditions['user_id'] = ['exp', ' not in (' . $oldQuery . ')']; - $items = M('spend', 'tab_')->field('count(distinct user_id) count, game_id')->where($conditions)->group('game_id')->select(); + $items = M('spend use index(spend_search)', 'tab_')->field('count(distinct user_id) count, game_id')->where($conditions)->group('game_id')->select(); return $this->assembleRecords($items, $gameIds, 'count', 'game_id'); } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 1c4f73d6a..c73569d46 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1326,6 +1326,7 @@ class QueryController extends BaseController $promoteService = new PromoteService(); $allGameIs = $promoteService->getHistoryGameIds($loginPromote); + if ($allGameIs && count($allGameIs) > 0) { $map['_string'] .= ' and id in(' . implode(',', $allGameIs) . ')'; } else { From 197e129f04bcee77e9fdc80d28892dcb3321a339 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 11 Jan 2021 18:56:38 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E6=AF=94=E4=BE=8B=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 4 ++-- Application/Payment/Common/extend.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index a7c1ef372..a86e66aab 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2088,9 +2088,9 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $ // $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['sum_money']); if ($data['withdraw_type'] != 3) { - $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})"); + $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*D{$line}*(1-E{$line}),2)"); } else { - $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*E{$line}"); + $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*E{$line}),2)"); } } $objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name); diff --git a/Application/Payment/Common/extend.php b/Application/Payment/Common/extend.php index 1cb8c0d56..02253aa17 100644 --- a/Application/Payment/Common/extend.php +++ b/Application/Payment/Common/extend.php @@ -2022,7 +2022,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['pay_amount']); // $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['sum_money']); - $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})"); + $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*D{$line}*(1-E{$line}),2)"); } $objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name); $pay_amount_str .= "F{$line}+"; From 174219d9d517251e8ceedbf29f1f618484b90119 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 11 Jan 2021 18:59:36 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index a86e66aab..24bc6b573 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1956,9 +1956,9 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_ $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['pay_amount']); // $objPHPExcel->getActiveSheet()->setCellValue('J'.$line, $value['sum_money']); if ($data['pay_type'] == 2) { - $objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=E{$line}*(1-H{$line})*G{$line}*(1-I{$line})"); + $objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=ROUND(E{$line}*(1-H{$line})*G{$line}*(1-I{$line}),2)"); }else{ - $objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=E{$line}*(1-H{$line})*F{$line}*(1-I{$line})"); + $objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=ROUND(E{$line}*(1-H{$line})*F{$line}*(1-I{$line}),2)"); } } @@ -2207,7 +2207,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['pay_amount']); // $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['sum_money']); - $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})"); + $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*D{$line}*(1-E{$line}),2)"); } $objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name); $line++; From 7054f82fdea55f5b9ad6f1ff0758fed7a98f63f9 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 13 Jan 2021 09:35:02 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E8=A1=A5=E7=82=B9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementController.class.php | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index d6b84bc75..b70cdca38 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -591,6 +591,8 @@ class CompanyStatementController extends ThinkController $line = 1; $count = []; + + $week_line = 2; //获取对接人 foreach($infolist as $k=>&$v){ $infolist[$k]['reward'] = 0; @@ -622,6 +624,9 @@ class CompanyStatementController extends ThinkController $v['statement_money'] = "=ROUND("; } + $handle_data = A("CompanyStatementPool")->changeDataStruct($v['statement_info'],$is_export,$week_line); + $v['statement_info'] = $handle_data; + $row = 0; foreach($v['statement_info'] as $ke=>&$va){ $va['row'] = count($va['game_list']); @@ -639,12 +644,12 @@ class CompanyStatementController extends ThinkController if($is_export){ if($v['withdraw_type'] != 3) { - $val['sum_money'] = "=ROUND(K{$line}*(L{$line}+M{$line}),2)"; + $val['sum_money'] = "=ROUND((K{$line}-L{$line})*(M{$line}+N{$line}),2)"; } else { - $val['sum_money'] = "=ROUND(K{$line}*(M{$line}),2)"; + $val['sum_money'] = "=ROUND((K{$line}-L{$line})*(N{$line}),2)"; } // $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})"; - $v['statement_money'] .= "N{$line}+"; + $v['statement_money'] .= "S{$line}+"; }else{ $count['platform_amount'] += $val['pay_amount']; $count['sum_money'] += $val['sum_money']; @@ -674,10 +679,18 @@ class CompanyStatementController extends ThinkController } } +// if($is_export){ +// $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; +// $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)"; +// } + if($is_export){ $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)"; - $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)"; + $count["week_money"] = "=ROUND(SUM(S2:S".$line."),2)"; + $count["sum_money"] = "=ROUND(SUM(T2:T".$line."),2)"; } + + $this->assign("withdraw_type",3); $this->assign("data",$infolist); $this->assign("count",$count); $this->assign("is_export",$is_export); From 2366a215a21c658c1f0cd17f0926987e9689ce86 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 18 Jan 2021 13:49:03 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E5=A5=96=E6=83=A9=E5=85=88=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E9=99=90=E5=88=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StatementMangementController.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index 19f2096b4..10741d25b 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -524,10 +524,10 @@ class StatementMangementController extends ThinkController if ($id) { - $checkReward = $this->checkRewardDetail($settlmentSet); - if ($checkReward) { - return $this->error("奖惩确认时间需在结算时间以后,请重新选择"); - } +// $checkReward = $this->checkRewardDetail($settlmentSet); +// if ($checkReward) { +// return $this->error("奖惩确认时间需在结算时间以后,请重新选择"); +// } $upt = M('reward_record', 'tab_')->where(['id'=>$id])->save($data); if ($upt === false) { @@ -543,10 +543,10 @@ class StatementMangementController extends ThinkController } } else { - $checkReward = $this->checkRewardDetail($settlmentSet); - if ($checkReward) { - return $this->error("奖惩确认时间需在结算时间以后,请重新选择"); - } +// $checkReward = $this->checkRewardDetail($settlmentSet); +// if ($checkReward) { +// return $this->error("奖惩确认时间需在结算时间以后,请重新选择"); +// } $data['create_time'] = time(); $data['creater_id'] = is_login(); From 963e8062183444c01f52c07b05c9f81354cf8e8f Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 18 Jan 2021 14:30:25 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=A5=96=E6=83=A9=E9=99=90=E5=88=B6?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StatementMangementController.class.php | 73 ++++++++++++------- 1 file changed, 48 insertions(+), 25 deletions(-) diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index 10741d25b..d97f8a4bf 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -524,10 +524,10 @@ class StatementMangementController extends ThinkController if ($id) { -// $checkReward = $this->checkRewardDetail($settlmentSet); -// if ($checkReward) { -// return $this->error("奖惩确认时间需在结算时间以后,请重新选择"); -// } + $checkReward = $this->checkRewardDetail($settlmentSet); + if ($checkReward) { + return $this->error("奖惩确认时间需在结算时间以后,请重新选择"); + } $upt = M('reward_record', 'tab_')->where(['id'=>$id])->save($data); if ($upt === false) { @@ -543,10 +543,10 @@ class StatementMangementController extends ThinkController } } else { -// $checkReward = $this->checkRewardDetail($settlmentSet); -// if ($checkReward) { -// return $this->error("奖惩确认时间需在结算时间以后,请重新选择"); -// } + $checkReward = $this->checkRewardDetail($settlmentSet); + if ($checkReward) { + return $this->error("奖惩确认时间需在结算时间以后,请重新选择"); + } $data['create_time'] = time(); $data['creater_id'] = is_login(); @@ -623,26 +623,49 @@ class StatementMangementController extends ThinkController public function checkRewardDetail($settlmentSet = []) { + $pool_data = M("company_statement_pool","tab_")->field('id,statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time') + ->where([ + 'verify_status'=>['egt',2] + ]) + ->select(); foreach ($settlmentSet as $key => $value) { - if ($value['company_id']) { - $sql = "(select statement_begin_time,statement_end_time,company_id,company_name from tab_company_statement - union all select statement_begin_time,statement_end_time,company_id,company_name from tab_company_statement_info - union all select statement_begin_time,statement_end_time,company_id,company_name from tab_company_lack_statement_info where is_pool=0)statement_info"; - - $data = M()->table("$sql") - ->where( - [ - 'statement_begin_time'=>['elt',$value['confirm_time']], - 'statement_end_time'=>['egt',$value['confirm_time']], - 'company_id'=>$value['company_id'] - ] - ) - ->select(); - - if ($data) { - return true; + foreach ($pool_data as $pkey => $pvalue) { + $infolist = []; + if ($pvalue['verify_status'] != 6) { + + //获取基本信息 + $infolist = M("company_statement_info", "tab_")->field("*,'1' as st") +// ->where("pool_id = '{$pvalue['id']}'") + ->where([ + 'statement_begin_time' => ['elt', $value['confirm_time']], + 'statement_end_time' => ['egt', $value['confirm_time']], + 'company_id' => $value['company_id'], + 'pool_id'=>$pvalue['id'], + ]) + ->select(); + //获取母单 + if (!empty($pvalue['create_lack_ids'])) { + $l_ids = explode(',',$pvalue['create_lack_ids']); + $lack_info = M("company_lack_statement_info", "tab_") + ->field("*,'0' as st") +// ->where("id in ({$l_ids})") + ->where([ + 'id'=>['in',$l_ids], + 'statement_begin_time' => ['elt', $value['confirm_time']], + 'statement_end_time' => ['egt', $value['confirm_time']], + 'company_id' => $value['company_id'], + ]) + ->select(); + $infolist = array_merge($infolist, $lack_info); + } + + if ($infolist) { + return true; + } + + } } From 508f4abef1a7bc75bd2b711a51908d91f366d70e Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 18 Jan 2021 14:32:00 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=A5=96=E6=83=A9=E9=99=90=E5=88=B6?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/StatementMangementController.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index d97f8a4bf..ed8c47fb4 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -625,7 +625,8 @@ class StatementMangementController extends ThinkController $pool_data = M("company_statement_pool","tab_")->field('id,statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time') ->where([ - 'verify_status'=>['egt',2] + 'verify_status'=>['egt',2], + 'withdraw_type'=>['neq',3] ]) ->select(); foreach ($settlmentSet as $key => $value) { From 07c95d2ea7fab1e61ca5c20e073c868324f3e7dc Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 20 Jan 2021 11:12:48 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E5=89=91=E7=A0=B4=E9=95=BF=E7=A9=BA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Tool/GameResource.class.php | 18 +- .../Tool/GameResource/JxjClient.class.php | 155 ------------------ ...Client.class.php => LeyouClient.class.php} | 4 +- 3 files changed, 12 insertions(+), 165 deletions(-) delete mode 100644 Application/Base/Tool/GameResource/JxjClient.class.php rename Application/Base/Tool/GameResource/{JtxcClient.class.php => LeyouClient.class.php} (99%) diff --git a/Application/Base/Tool/GameResource.class.php b/Application/Base/Tool/GameResource.class.php index c7992b47f..4e7e7a12f 100644 --- a/Application/Base/Tool/GameResource.class.php +++ b/Application/Base/Tool/GameResource.class.php @@ -19,14 +19,16 @@ class GameResource private $game; private $clientMap = [ - 191 => JtxcClient::class, - 192 => JtxcClient::class, - 231 => LsxxClient::class, - 232 => LsxxClient::class, - 229 => YzchzbClient::class, - 230 => YzchzbClient::class, - 239 => JxjClient::class, - 240 => JxjClient::class, + 191 => LeyouClient::class, // 九天仙尘(安卓版) + 192 => LeyouClient::class, // 九天仙尘(苹果版) + 229 => YzchzbClient::class, // 远征手游之楚汉争霸(安卓版) + 230 => YzchzbClient::class, // 远征手游之楚汉争霸(苹果版) + 231 => LsxxClient::class, // 乱世枭雄(安卓版) + 232 => LsxxClient::class, // 乱世枭雄(苹果版) + 239 => LeyouClient::class, // 剑仙诀(安卓版) + 240 => LeyouClient::class, // 剑仙诀(苹果版) + 247 => LeyouClient::class, // 剑破长空(安卓版) + 248 => LeyouClient::class, // 剑破长空(苹果版) ]; public function __construct($game) diff --git a/Application/Base/Tool/GameResource/JxjClient.class.php b/Application/Base/Tool/GameResource/JxjClient.class.php deleted file mode 100644 index 85b38eb8c..000000000 --- a/Application/Base/Tool/GameResource/JxjClient.class.php +++ /dev/null @@ -1,155 +0,0 @@ - ['uri' => '/api/game/sendGold/zhuimeng/jxlm/57972', 'method' => 'post'], - ]; - - public function __construct() - { - $this->client = new Client([ - 'base_uri' => 'http://chat.leniu.com', - 'timeout' => 10.0, - ]); - } - - public function api($api, array $params = []) - { - $api = $this->apis[$api] ?? null; - if (is_null($api)) { - throw new \Exception('接口不存在'); - } - $params[self::SIGN_NAME] = $this->sign($params); - try { - return $this->request($api, $params); - } catch (\Exception $e) { - $env = C('APP_ENV', null, 'prod'); - return $e->getMessage(); - } - } - - public function request($api, $params) - { - if ($api['method'] == 'get') { - return $this->get($api['uri'], $params); - } else { - return $this->post($api['uri'], $params); - } - } - - protected function post($uri, array $params = []) - { - $response = $this->client->post($uri, [ - 'verify' => false, - 'form_params' => $params, - ]); - return (string)$response->getBody(); - } - - protected function get($uri, array $params = []) - { - $response = $this->client->get($uri, [ - 'verify' => false, - 'query' => $params, - ]); - return (string)$response->getBody(); - } - - protected function sign($params) - { - unset($params[self::SIGN_NAME]); - ksort($params); - $signRows = []; - foreach ($params as $key => $value) { - $signRows[] = $key . '=' . $value; - } - return md5(implode('&', $signRows) . self::KEY); - } - - public function apply($order, $role) - { - $result = $this->api('provide', [ - 'role_id' => $role['role_id'], - 'money' => intval($order['ref_amount']) * 10, - 'type' => 2, - // 'goods_id' => 0, - 'server_no' => $role['server_id'], - ]); - if ($result == 'SUCCESS') { - return [ - 'status' => true, - 'message' => $result, - 'result' => ['result' => $result] - ]; - } else { - return [ - 'status' => false, - 'message' => $result, - 'result' => ['result' => $result] - ]; - } - } - - public function getResourceTypes($deviceType) - { - if ($deviceType == 'andriod') { - return [['id' => 1, 'name' => '通用', 'device_type' => 'andriod']]; - } elseif ($deviceType == 'ios') { - return [['id' => 2, 'name' => '通用', 'device_type' => 'ios']]; - } - } - - public function getResources($typeId, $deviceType) - { - return [ - 1 => ['ref_id' => 1, 'name' => '60元宝', 'amount' => 6], - 2 => ['ref_id' => 2, 'name' => '300元宝', 'amount' => 30], - 3 => ['ref_id' => 3, 'name' => '980元宝', 'amount' => 98], - 4 => ['ref_id' => 4, 'name' => '1280元宝', 'amount' => 128], - 5 => ['ref_id' => 5, 'name' => '1980元宝', 'amount' => 198], - 6 => ['ref_id' => 6, 'name' => '3280元宝', 'amount' => 328], - 7 => ['ref_id' => 7, 'name' => '6480元宝', 'amount' => 648], - 8 => ['ref_id' => 8, 'name' => '10000元宝', 'amount' => 1000], - 9 => ['ref_id' => 9, 'name' => '20000元宝', 'amount' => 2000], - 10 => ['ref_id' => 10, 'name' => '30000元宝', 'amount' => 3000], - 11 => ['ref_id' => 11, 'name' => '50000元宝', 'amount' => 5000], - 12 => ['ref_id' => 12, 'name' => '100000元宝', 'amount' => 10000], - 13 => ['ref_id' => 13, 'name' => '200000元宝', 'amount' => 20000], - 14 => ['ref_id' => 14, 'name' => '680元宝', 'amount' => 68], - ]; - - /* return [ - ['ref_id' => 121209, 'name' => '6元充值卡', 'amount' => 6], - ['ref_id' => 121210, 'name' => '30元充值卡', 'amount' => 30], - ['ref_id' => 121211, 'name' => '98元充值卡', 'amount' => 98], - ['ref_id' => 121212, 'name' => '128元充值卡', 'amount' => 128], - ['ref_id' => 121213, 'name' => '198元充值卡', 'amount' => 198], - ['ref_id' => 121214, 'name' => '328元充值卡', 'amount' => 328], - ['ref_id' => 121215, 'name' => '648元充值卡', 'amount' => 648], - ['ref_id' => 121216, 'name' => '1000元充值卡', 'amount' => 1000], - ['ref_id' => 121217, 'name' => '2000元充值卡', 'amount' => 2000], - ['ref_id' => 121218, 'name' => '3000元充值卡', 'amount' => 3000], - ['ref_id' => 121219, 'name' => '5000元充值卡', 'amount' => 5000], - ['ref_id' => 121220, 'name' => '10000元充值卡', 'amount' => 10000], - ['ref_id' => 121221, 'name' => '20000元充值卡', 'amount' => 20000], - ['ref_id' => 121222, 'name' => '68元充值卡', 'amount' => 68], - ]; */ - } -} \ No newline at end of file diff --git a/Application/Base/Tool/GameResource/JtxcClient.class.php b/Application/Base/Tool/GameResource/LeyouClient.class.php similarity index 99% rename from Application/Base/Tool/GameResource/JtxcClient.class.php rename to Application/Base/Tool/GameResource/LeyouClient.class.php index a1ef1b961..126cad57d 100644 --- a/Application/Base/Tool/GameResource/JtxcClient.class.php +++ b/Application/Base/Tool/GameResource/LeyouClient.class.php @@ -6,9 +6,9 @@ use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; /** - * 九天仙尘-测试资源接口 + * 乐游-通用测试资源接口 */ -class JtxcClient +class LeyouClient { const SIGN_NAME = 'sign'; const SUCCESS = '0000'; From d08df7febae9549e94831b4e8539b6c523166b87 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 20 Jan 2021 14:29:23 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Tool/GameResource.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Application/Base/Tool/GameResource.class.php b/Application/Base/Tool/GameResource.class.php index 4e7e7a12f..28f52881d 100644 --- a/Application/Base/Tool/GameResource.class.php +++ b/Application/Base/Tool/GameResource.class.php @@ -7,8 +7,7 @@ use GuzzleHttp\Exception\RequestException; use Base\Tool\GameResource\YzchzbClient; use Base\Tool\GameResource\LsxxClient; -use Base\Tool\GameResource\JtxcClient; -use Base\Tool\GameResource\JxjClient; +use Base\Tool\GameResource\LeyouClient; /** * 游戏资源接口