From 9da9941c9f8eac142e172321e1376125bba495fc Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 26 Nov 2020 10:41:30 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/SpendController.class.php | 38 ++++++++++++- Application/Admin/View/Spend/lists.html | 56 +++++++++++++++++-- 2 files changed, 88 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index fad764a01..35b2470b4 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -11,6 +11,11 @@ use User\Api\UserApi as UserApi; class SpendController extends ThinkController { const model_name = 'Spend'; + const IsCheckStr=[ + "1"=>"是", + "2"=>"否" + ]; + public $OpAuthList; public function lists() { @@ -24,6 +29,10 @@ class SpendController extends ThinkController unset($_REQUEST['timestart']); unset($_REQUEST['timeend']); + if (isset($_REQUEST['is_check'])) { + $map['is_check'] = (int)($_REQUEST['is_check']); + } + if (isset($_REQUEST['user_account'])) { $map['user_account'] = array('like', trim($_REQUEST['user_account'])); unset($_REQUEST['user_account']); @@ -142,13 +151,13 @@ class SpendController extends ThinkController $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Spend/lists', 'status' => 1])->find()); $data = D(self::model_name)->lists($_GET["p"], $map, $order); - + $adminUsernameList = getAdminUsernameList(array_column($data['data'], 'market_admin_id')); foreach ($data['data'] as $key=>&$value ) { ($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):''; $value['market_admin_username'] = $adminUsernameList[$value['market_admin_id']] ?? '无'; + $value['is_check_str'] = self::IsCheckStr[$value['is_check']]; } - $this->assign('showMarketAdmin', session('user_auth')['show_market_admin']); $this->assign('showPromote', session('user_auth')['show_promote']); $this->assign('isMarketAdmin', $isMarketAdmin); @@ -159,8 +168,33 @@ class SpendController extends ThinkController $this->assign('_page', $data['page']); $show_data_power = (is_administrator()|| session('user_auth')['show_data']); $this->assign('show_data_power', $show_data_power); + + if(!IS_ROOT){ + $this->OpAuthList= getModuleControllerAuth(); + } + + $this->assign('menubtn',$this->menuAuth()); $this->display(); } + + protected function menuAuth() + { + $mentBtn = [ + "addStatement"=>"参与结算", + "removeStatement"=>"移出结算", + ]; + $resarr = []; + foreach ($mentBtn as $k => $v) { + if(IS_ROOT){ + $resarr[] = $v; + }else{ + if(in_array($k,$this->OpAuthList)){ + $resarr[] = $v; + } + } + } + return $resarr; + } /** * 充值补单功能 diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index 47eec6745..eb6b45ff5 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -31,6 +31,34 @@ line-height: 1.5; padding:5px; } + .search_list{ + margin-bottom: 15px; + } + .butnbox {padding:10px 0 10px;} + .butnbox .butnlist {overflow:hidden;clear:both;} + .butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;} + .butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;} + .butnbox .butnlist .butn.last {background:#009900;} + .butnbox .butnlist .butn~.butn {margin-left:20px;} + .data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;} + .layui-layer-title { + text-align: center; + height: 80px; + line-height: 80px; + font-weight: 600; + font-size: 18px; + } + .data_list table td{ + line-height: 2; + } + + .layui-layer-title { + text-align: center; + height: 42px; + line-height: 42px; + font-weight: 400; + font-size: 14px; + } @@ -158,6 +186,16 @@ + +
+ +
+
@@ -166,7 +204,13 @@
- + +
+
+ + {$vo} + +
@@ -177,6 +221,7 @@ + 支付订单号 CP订单号 @@ -206,16 +251,18 @@ 充值方式 订单状态 游戏通知状态 + 是否参与结算 操作 - aOh! 暂时还没有内容! + aOh! 暂时还没有内容! + {$data.pay_order_number} @@ -295,6 +342,7 @@ {:get_info_status($data['pay_game_status'],14)} + {$data.is_check_str} - 汇总 - + 汇总 + 当页充值:{:null_to_0(array_sum(array_column(array_status2value('pay_status','',$list_data),'pay_amount')))} From eeb18218598873e8f1514e6e956b7eea52291d73 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 26 Nov 2020 17:16:17 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/SpendController.class.php | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 35b2470b4..077ecf406 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -195,7 +195,46 @@ class SpendController extends ThinkController } return $resarr; } - + + public function addStatement() + { + if(!isset($_REQUEST['ids']) || !isset($_REQUEST['type'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + + $dbres = D(self::model_name)->where("id in ({$ids}) and type = '1'")->select(); + if(empty($dbres)){ + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"加入结算成功" + )); + } + $ids = array_column($dbres,"id"); + + foreach ($dbres as $key=>$value) { + if($value['withdraw_type'] !=3) { + $this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete(); + } else { + $this->DBModel->where("id = {$value['id']} and verify_status != 2")->delete(); + } + + } + addOperationLog(['op_type'=>2,'key'=>$ids,"op_name"=>"删除结算单",'url'=>U('lists')]); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"删除成功" + )); + } + protected function editOrderIscheck($ids,$oldval,$newval){ + $dbres = D(self::model_name)->where("id in ({$ids}) and type = '{$oldval}'")->select(); + if(empty($dbres)) return false; + $changeIds = array_column($dbres,"id"); + //执行操作 + $res = D(self::model_name)->where("id in ({$changeIds}) and type = '{$oldval}'")->save(['is_check'=>$newval]); + if(empty($res)) return false; + + return array_column($dbres,"id"); + + } /** * 充值补单功能 */ From 74d9d6ed181b64f9382a3fb6b27d703bae67e0d7 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 27 Nov 2020 10:24:48 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=85=E5=80=BC?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 7 +- .../Controller/SpendController.class.php | 64 ++++++++----------- Application/Admin/View/Spend/lists.html | 59 ++++++++++++++++- 3 files changed, 91 insertions(+), 39 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 60c63486b..f47a6c040 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2556,14 +2556,14 @@ function getCompanyBlongOther($id = -1) * array( * op_type=>操作类型 0:新增,1:编辑 2:删除 3:下载, * op_name=>操作说明 例如:编辑,删除,锁定等, - * url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面), + * url=>U函数可以跳转 的操作地址, * key=>关键词:用户的账号,游戏的名词等, * menu=>非必须,菜单目录,不存在的话按控制器寻找。 * ) */ function addOperationLog($options) { - $checkarr = ['op_type','url','key']; + $checkarr = ['op_type','key']; foreach ($checkarr as $v) { if(!array_key_exists($v,$options)){ return false; @@ -2572,6 +2572,9 @@ function addOperationLog($options) if(!array_key_exists("op_name",$options)){ $options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :($options['op_type'] == 3 ? "导出" :"新增"))); } + if(!array_key_exists("url",$options)){ + $options['url'] = MODULE_NAME."/".CONTROLLER_NAME."/".ACTION_NAME; + } //获取ip $addarray = [ "op_ip"=>$_SERVER['REMOTE_ADDR'], diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 077ecf406..efec7a82b 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -198,50 +198,42 @@ class SpendController extends ThinkController public function addStatement() { - if(!isset($_REQUEST['ids']) || !isset($_REQUEST['type'])) $this->error("参数错误"); + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); $ids = $_REQUEST['ids']; - - $dbres = D(self::model_name)->where("id in ({$ids}) and type = '1'")->select(); - if(empty($dbres)){ - $this->ajaxReturn(array( - 'status' => 1, - "info"=>"加入结算成功" - )); - } - $ids = array_column($dbres,"id"); - - foreach ($dbres as $key=>$value) { - if($value['withdraw_type'] !=3) { - $this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete(); - } else { - $this->DBModel->where("id = {$value['id']} and verify_status != 2")->delete(); - } - - } - addOperationLog(['op_type'=>2,'key'=>$ids,"op_name"=>"删除结算单",'url'=>U('lists')]); + $this->editOrderIscheck($ids,2,1); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"操作成功" + )); + } + public function removeStatement() + { + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + $this->editOrderIscheck($ids,1,2); $this->ajaxReturn(array( 'status' => 1, - "info"=>"删除成功" + "info"=>"操作成功" )); + } protected function editOrderIscheck($ids,$oldval,$newval){ - $dbres = D(self::model_name)->where("id in ({$ids}) and type = '{$oldval}'")->select(); + $dbres = D(self::model_name)->where("id in ({$ids}) and is_check = '{$oldval}'")->select(); if(empty($dbres)) return false; - $changeIds = array_column($dbres,"id"); + + $changeIds = implode(",",array_column($dbres,"id")); //执行操作 - $res = D(self::model_name)->where("id in ({$changeIds}) and type = '{$oldval}'")->save(['is_check'=>$newval]); + $res = D(self::model_name)->where("id in ({$changeIds}) and is_check = '{$oldval}'")->save(['is_check'=>$newval]); if(empty($res)) return false; - - return array_column($dbres,"id"); - + //日志 + if($newval == 1){ + $op_name = "加入结算"; + $key = "addStatement"; + }else{ + $op_name = "移出结算"; + $key = "removeStatement"; + } + addOperationLog(['op_type'=>1,'key'=>$key,"op_name"=>$op_name,"content"=>json_encode(["ids"=>$_REQUEST['ids'],"is_check"=>$newval])]); + return true; } - /** - * 充值补单功能 - */ - public function order_repair() { - if (IS_AJAX) { - - } - } - } diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index eb6b45ff5..ee308c9b4 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -262,7 +262,7 @@ - + {$data.pay_order_number} @@ -718,6 +718,63 @@ }); $("#game_name").change(); + $("#addStatement,#removeStatement").on("click",function(){ + var id = $(this).attr("id"); + if(id == "addStatement"){ + var opname = "参与结算"; + var opurl = "{:U('addStatement')}"; + var opst ="[不参与结算]"; + var status = [2]; + }else if(id=="removeStatement"){ + var opname = "移出结算"; + var opurl = "{:U('removeStatement')}"; + var opst ="[参与结算]"; + var status = [1]; + } + var flag = false; + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + const ischeck = $(elem).data("ischeck"); + if($.inArray(ischeck,status) > -1){ + return $(elem).val(); + } + }).get(); + if(text.length < 1){ + layer.msg("" + '无需要'+opname+'的操作,仅'+opst+'状态可以进行'+opname+""); + return; + } + text = text.join(","); + layer.confirm('【提示】'+opname+'操作后,相应的结算单需要进行重算后生效', { + btn: ['确认','取消'], + title:false + }, function(index){ + layer.close(index); + layer.load(2); + $.ajax({ + type: "POST", + url: opurl, + dataType: 'json', + async: true, + data: {ids:text}, + success:function(data){ + layer.closeAll('loading'); + if(data.status==1){ + layer.msg("" + data.info + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + }else{ + layer.msg("" + data.info + ""); + return false; + } + } + }); + }); + + + + + }) + /** * 初始化select2单选,默认带搜索功能。 */ From 2d0bba8de50c017696863160305ae92c83ac7054 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 27 Nov 2020 17:43:08 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E6=B8=B8=E6=88=8F=E6=93=8D=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 25e0b7c3f..131eb3c59 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -1189,6 +1189,9 @@ class PromoteCompanyController extends ThinkController $is_change_game = false; $Promote = M("Promote", "tab_"); if($old_info['game_ids'] != $game_ids){ + //操作日志 + $this->addCompanyGameChangeLog($company_id,$old_info['game_ids'],$game_ids); + if($old_info['company_belong'] == 1 || $old_info['company_belong'] == 2){ //外团跟随公司 $new_game_ids = D("Game")->changeRelationGameidToGameid($game_ids,true); @@ -1228,6 +1231,20 @@ class PromoteCompanyController extends ThinkController } } } + protected function addCompanyGameChangeLog($company_id,$old_game_ids,$new_game_ids){ + $old_game_ids = explode(',',$old_game_ids); + $new_game_ids = explode(',',$new_game_ids); + $addGameid = array_diff($new_game_ids,$old_game_ids); + $removeGameid = array_diff($old_game_ids,$new_game_ids); + if(!empty($addGameid)){ + $gameid = implode(',',$addGameid); + addOperationLog(['op_type'=>1,'key'=>"addCompanyGame","op_name"=>"新增推广游戏","content"=>json_encode(["company_id"=>$company_id,"relation_game_id"=>$gameid])]); + } + if(!empty($removeGameid)){ + $gameid = implode(',',$removeGameid); + addOperationLog(['op_type'=>1,'key'=>"removeCompanyGame","op_name"=>"移除推广游戏","content"=>json_encode(["company_id"=>$company_id,"relation_game_id"=>$gameid])]); + } + } /** * 由于修改公司信息引起的会长信息修改 * @param [type] $save From 9ddfb6f79418c67e4fa3e583484a974450c54028 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 27 Nov 2020 18:38:06 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/FinancePromoteController.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 894738ec6..b38e6f4c0 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -282,6 +282,7 @@ class FinancePromoteController extends AdminController $map['s.market_admin_id'] = $adminId; } $map['s.pay_status']=1; + $map['s.is_check']=1; $field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count, @@ -511,6 +512,7 @@ class FinancePromoteController extends AdminController $map['s.market_admin_id'] = $adminId; } $map['s.pay_status']=1; + $map['s.is_check']=1; // dd($map); $field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, @@ -775,6 +777,8 @@ class FinancePromoteController extends AdminController $row = 10; } $map['pay_status'] = 1; + $map['is_check'] = 1; + if (!empty(I("game_id"))) { $map['game_id'] = I("game_id"); } @@ -893,6 +897,7 @@ class FinancePromoteController extends AdminController } $map['s.pay_status']=1; + $map['s.is_check']=1; $query = M("spend","tab_")->alias("s") ->field("s.game_id,s.game_name,s.sdk_version,p.partner as partner_name, SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, @@ -946,7 +951,7 @@ class FinancePromoteController extends AdminController ->join("tab_promote promote ON s.promote_id = promote.id","left") ->join("tab_promote_company company ON promote.company_id = company.id","left"); } - $data = $query->where(['s.pay_status' => 1]) + $data = $query->where(['s.pay_status' => 1,'s.is_check'=>1]) ->where($map) ->find(); return $data; @@ -996,6 +1001,7 @@ class FinancePromoteController extends AdminController $row = 10; } $map['pay_status'] = 1; + $map['is_check'] = 1; if (!empty(I('user_account'))) { $map['tab_spend.user_account'] = array('like','%'.I("user_account").'%'); From b9b497e2557dbbd06f71921b59702060c3c8ac41 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 27 Nov 2020 18:44:49 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=AC=E4=BC=9A?= =?UTF-8?q?=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/FinancePromote/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/View/FinancePromote/index.html b/Application/Admin/View/FinancePromote/index.html index 545faf957..8657f62fc 100644 --- a/Application/Admin/View/FinancePromote/index.html +++ b/Application/Admin/View/FinancePromote/index.html @@ -81,7 +81,7 @@