master
yulingwei 4 years ago
parent e155c92ed6
commit c8bd476a60

@ -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();
}

@ -76,9 +76,9 @@
<div class="input-list input-list-server search_label_rehab">
<select id="partner_id" name="partner_id" class="select_gallery" style="width:120px;">
<option value="">请选择合作公司</option>
<volist name=":getPartner()" id="vo">
<!-- <volist name=":getPartner()" id="vo">
<option partner-id="{$vo.id}" value="{$vo.id}" data-type="{$vo.type}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
</volist>
</volist> -->
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
@ -167,7 +167,7 @@
<td rowspan="{$data.row}">{$data.promote_account}</td>
<td rowspan="{$data.row}">{$data.relation_game_name}</td>
<td rowspan="{$data.row}">{$data.partner_name}</td>
<td>{$item['price']}</td>
<td>{$promoters[$item['promote_id']]}-{$item['price']}</td>
<td rowspan="{$data.row}">{$data.money}</td>
<td rowspan="{$data.row}">{$data['reward_time']}</td>
<td rowspan="{$data.row}">{$data['confirm_time']}</td>
@ -177,7 +177,7 @@
<a class="confirm ajax-get" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
</td>
<?php else:?>
<td>{$item['price']}</td>
<td>{$promoters[$item['promote_id']]}-{$item['price']}</td>
<?php endif;?>
</tr>
<?php endforeach;?>
@ -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(){

@ -289,7 +289,6 @@
autoclose : true,
todayBtn : true,
todayHighlight : true,
startDate : monthStart,
language : 'zh-CN',
startView : 2,//月视图
showMeridian : true,

Loading…
Cancel
Save