diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 6c877ad5e..d9d631072 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2576,7 +2576,7 @@ function getCompanyBlongOther($id = -1) * array( * op_type=>操作类型 0:新增,1:编辑 2:删除 3:下载, * op_name=>操作说明 例如:编辑,删除,锁定等, - * url=>需要跳转的url 添加去列表加唯一id,编辑直接去编辑页面,下载可以重新下载(新开页面), + * url=>U函数可以跳转 的操作地址, * key=>关键词:用户的账号,游戏的名词等, * menu=>非必须,菜单目录,不存在的话按控制器寻找。 * ) 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").'%'); diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 0d47f5553..a1d87edb6 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -1335,6 +1335,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); @@ -1374,6 +1377,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 diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index fad764a01..efec7a82b 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,16 +168,72 @@ 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(); } - - /** - * 充值补单功能 - */ - public function order_repair() { - if (IS_AJAX) { - + + 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; + } + + public function addStatement() + { + if(!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + $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"=>"操作成功" + )); + } + protected function editOrderIscheck($ids,$oldval,$newval){ + $dbres = D(self::model_name)->where("id in ({$ids}) and is_check = '{$oldval}'")->select(); + if(empty($dbres)) return false; + + $changeIds = implode(",",array_column($dbres,"id")); + //执行操作 + $res = D(self::model_name)->where("id in ({$changeIds}) and is_check = '{$oldval}'")->save(['is_check'=>$newval]); + if(empty($res)) return false; + //日志 + 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; + } } diff --git a/Application/Admin/View/FinancePromote/index.html b/Application/Admin/View/FinancePromote/index.html index 545faf957..49216715f 100644 --- a/Application/Admin/View/FinancePromote/index.html +++ b/Application/Admin/View/FinancePromote/index.html @@ -81,7 +81,7 @@
说明:公会相关统计
+说明:公会相关统计不含不参与结算的订单数据