diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index 69f8a1e01..7062b1001 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -11,7 +11,6 @@ use User\Api\UserApi as UserApi; class StatementMangementController extends ThinkController { public function lists() { - $map = []; if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { @@ -94,7 +93,6 @@ class StatementMangementController extends ThinkController } $this->meta_title = '结算单管理'; $this->assign('data',$data); - $this->display(); } @@ -252,17 +250,20 @@ class StatementMangementController extends ThinkController if (!empty(I("game_name"))) { $game_ids = array_column(getGameByName(I("game_name")), 'id'); if ($game_ids) { - $map['relation_game_id'] = ['in', $game_ids]; + $map['tab_reward_record.relation_game_id'] = ['in', $game_ids]; } } if (!empty(I('partner_id'))) { - $map['company_id'] = I('partner_id'); + $map['tab_reward_record.company_id'] = I('partner_id'); } if (strlen(I('company_type'))) { - $map['company_type'] = I('company_type'); + $map['tab_reward_record.company_type'] = I('company_type'); } if (!empty(I('account'))) { - $map['accounts'] = ['like', '%' . I('account') . '%']; + //$map['accounts'] = ['like', '%' . I('account') . '%']; + // 获取会长匹配的id + $promoterIds = M('promote', 'tab_')->where(['account'=>['like', '%' . I('account') . '%'], 'level'=>1])->getField('id'); + $map['tab_reward_record.promote_id'] = ['in', $promoterIds]; } $list = M('reward_record', 'tab_') ->field('tab_reward_record.*, tab_promote.account as promote_account, tab_game.partner_id') @@ -300,6 +301,7 @@ class StatementMangementController extends ThinkController $this->assign('_page', $page); } $this->assign('list', $list); + $this->assign('promoters', array_column(M('promote', 'tab_')->where(['level'=>1])->field('id, nickname')->select(), 'nickname', 'id')); $this->display(); } diff --git a/Application/Admin/View/StatementMangement/rewardManageList.html b/Application/Admin/View/StatementMangement/rewardManageList.html index a30a829d0..64cc8b045 100644 --- a/Application/Admin/View/StatementMangement/rewardManageList.html +++ b/Application/Admin/View/StatementMangement/rewardManageList.html @@ -76,9 +76,9 @@
@@ -167,7 +167,7 @@ {$data.promote_account} {$data.relation_game_name} {$data.partner_name} - {$item['price']} + {$promoters[$item['promote_id']]}-{$item['price']} {$data.money} {$data['reward_time']} {$data['confirm_time']} @@ -177,7 +177,7 @@ 删除 - {$item['price']} + {$promoters[$item['promote_id']]}-{$item['price']} @@ -224,10 +224,14 @@ $(".select_gallery").select2(); highlight_subnav("{:U('StatementMangement/rewardManageList')}"); + var partner_id = {$_GET['partner_id']}; function get_company_list() { - var id = $('#partner_id').val(); + var id = partner_id; var company_type = $("#company_type option:selected").val(); + if (company_type == '') { + return false; + } $.ajax({ url:"{:U('Ajax/getCompanyList')}", type:"post", @@ -276,12 +280,22 @@ }) } $(function(){ - get_company_list(); + // $("#partner_id").change(function(){ get_game_list(); }); - $("#company_type").change(function(){ + + if ($("#company_type").val() != '') { get_company_list(); + } + + $("#company_type").change(function(){ + if ($("#company_type").val() != '') { + get_company_list(); + } else { + $("#partner_id").empty(); + $("#partner_id").select2(); + } }); //搜索功能 $("#search").click(function(){ diff --git a/Application/Admin/View/StatementMangement/rewardManageSave.html b/Application/Admin/View/StatementMangement/rewardManageSave.html index df20e23e3..60aa66fd5 100644 --- a/Application/Admin/View/StatementMangement/rewardManageSave.html +++ b/Application/Admin/View/StatementMangement/rewardManageSave.html @@ -289,7 +289,6 @@ autoclose : true, todayBtn : true, todayHighlight : true, - startDate : monthStart, language : 'zh-CN', startView : 2,//月视图 showMeridian : true,