平台币充值添加推广员充值搜索

master
zhengyongxing 5 years ago
parent c329ec09f4
commit 8652c19f5c

@ -10,7 +10,7 @@ use User\Api\UserApi as UserApi;
class DepositController extends ThinkController { class DepositController extends ThinkController {
const model_name = 'Deposit'; const model_name = 'Deposit';
public function lists(){ public function lists($p = 1){
if(isset($_REQUEST['user_account'])){ if(isset($_REQUEST['user_account'])){
$map['user_account']=array('like','%'.trim($_REQUEST['user_account']).'%'); $map['user_account']=array('like','%'.trim($_REQUEST['user_account']).'%');
unset($_REQUEST['user_account']); unset($_REQUEST['user_account']);
@ -38,16 +38,10 @@ class DepositController extends ThinkController {
}else if(isset($_REQUEST['promote_id']) && $_REQUEST['promote_id']==0){ }else if(isset($_REQUEST['promote_id']) && $_REQUEST['promote_id']==0){
$map['promote_id']=array('elt',0); $map['promote_id']=array('elt',0);
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
}elseif(isset($_REQUEST['promote_name'])&&$_REQUEST['promote_id']==-1){ }elseif(isset($_REQUEST['promote_name'])&&$_REQUEST['promote_id']==-1){
$map['promote_id']=get_promote_id($_REQUEST['promote_name']); $map['promote_id']=get_promote_id($_REQUEST['promote_name']);
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
}else{ }else{
$map['promote_id']=$_REQUEST['promote_id']; $map['promote_id']=$_REQUEST['promote_id'];
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
} }
if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){ if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){
$map['create_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1)); $map['create_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1));
@ -94,6 +88,47 @@ class DepositController extends ThinkController {
$map1=$map; $map1=$map;
$map1['pay_status']=1; $map1['pay_status']=1;
if($_REQUEST['promote_id']||$_REQUEST['promote_id']=='0') {
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
$map1['order_status'] = 1;
unset($map1['pay_status']);
if ($map['pay_status']) {
$map['order_status']=$map['pay_status'];
}
$total=null_to_0(D('coin_pay_order')->where($map1)->sum('pay_amount'));
$ttotal=null_to_0(D('coin_pay_order')->where('create_time'.total(1))->where(array('pay_status'=>1))->sum('pay_amount'));
$ytotal=null_to_0(D('coin_pay_order')->where('create_time'.total(5))->where(array('pay_status'=>1))->sum('pay_amount'));
$this->assign('total',$total);
$this->assign('ttotal',$ttotal);
$this->assign('ytotal',$ytotal);
$data = D('coin_pay_order')
/* 查询指定字段,不指定则查询所有字段 */
->field('*,order_status as pay_status')
// 查询条件
->where($map)
/* 默认通过id逆序排列 */
->order("id desc")
/* 数据分页 */
->page($page, $row)
/* 执行查询 */
->select();
/* 查询记录总数 */
$count = D('coin_pay_order')->where($map)->count();
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->assign('list_data', $data);
$this->meta_title = '平台币充值列表';
$this->display('lists');die();
}
$total=null_to_0(D(self::model_name)->where($map1)->sum('pay_amount')); $total=null_to_0(D(self::model_name)->where($map1)->sum('pay_amount'));
$ttotal=null_to_0(D(self::model_name)->where('create_time'.total(1))->where(array('pay_status'=>1))->sum('pay_amount')); $ttotal=null_to_0(D(self::model_name)->where('create_time'.total(1))->where(array('pay_status'=>1))->sum('pay_amount'));
$ytotal=null_to_0(D(self::model_name)->where('create_time'.total(5))->where(array('pay_status'=>1))->sum('pay_amount')); $ytotal=null_to_0(D(self::model_name)->where('create_time'.total(5))->where(array('pay_status'=>1))->sum('pay_amount'));
@ -105,6 +140,7 @@ class DepositController extends ThinkController {
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Deposit/lists','status'=>1])->find()); $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Deposit/lists','status'=>1])->find());
$this->assign("is_admin",is_administrator()); $this->assign("is_admin",is_administrator());
parent::lists(self::model_name,$_GET["p"],$map); parent::lists(self::model_name,$_GET["p"],$map);
} }

@ -1235,16 +1235,10 @@ class ExportController extends Controller
} else if (isset($_REQUEST['promote_id']) && $_REQUEST['promote_id'] == 0) { } else if (isset($_REQUEST['promote_id']) && $_REQUEST['promote_id'] == 0) {
$map['promote_id'] = array('elt', 0); $map['promote_id'] = array('elt', 0);
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
} elseif (isset($_REQUEST['promote_name']) && $_REQUEST['promote_id'] == -1) { } elseif (isset($_REQUEST['promote_name']) && $_REQUEST['promote_id'] == -1) {
$map['promote_id'] = get_promote_id($_REQUEST['promote_name']); $map['promote_id'] = get_promote_id($_REQUEST['promote_name']);
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
} else { } else {
$map['promote_id'] = $_REQUEST['promote_id']; $map['promote_id'] = $_REQUEST['promote_id'];
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_name']);
} }
if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) { if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) {
$map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1)); $map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1));
@ -1266,30 +1260,70 @@ class ExportController extends Controller
} }
$map1 = $map; $map1 = $map;
$map1['pay_status'] = 1; $map1['pay_status'] = 1;
$total = D('Deposit')->where($map1)->sum('pay_amount');
if (isset($map['pay_status']) && $map['pay_status'] == 0) { if($_REQUEST['promote_id']||$_REQUEST['promote_id']=='0') {
$total = sprintf("%.2f", 0);
$map1['order_status'] = 1;
unset($map1['pay_status']);
if ($map['pay_status']) {
$map['order_status']=$map['pay_status'];
}
$total=null_to_0(D('coin_pay_order')->where($map1)->sum('pay_amount'));
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0);
} else {
$total = sprintf("%.2f", $total);
}
$xlsCell = array(
array('pay_order_number', "订单号"),
array('promote_account', L('Subordinate_channel')),
array('pay_amount', "充值平台币"),
array('pay_way', "充值方式", 'get_pay_way', '*'),
array('create_time', "充值时间"),
array('pay_status', L('Order_status'), 'get_info_status', '*', '9'),
array('', "共计充值{$total}"),
);
$xlsData = D('coin_pay_order')
/* 查询指定字段,不指定则查询所有字段 */
->field('*,order_status as pay_status')
// 查询条件
->where($map)
/* 默认通过id逆序排列 */
->order("id desc")
/* 执行查询 */
->select();
// var_dump($xlsData);die();
foreach ($xlsData as $key => $value) {
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
}
} else { } else {
$total = sprintf("%.2f", $total); $total = D('Deposit')->where($map1)->sum('pay_amount');
} if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0);
} else {
$total = sprintf("%.2f", $total);
}
$xlsCell = array( $xlsCell = array(
array('pay_order_number', "订单号"), array('pay_order_number', "订单号"),
array('user_account', "玩家账号"), array('user_account', "玩家账号"),
array('promote_account', L('Subordinate_channel')), array('promote_account', L('Subordinate_channel')),
array('pay_amount', "充值平台币"), array('pay_amount', "充值平台币"),
array('pay_way', "充值方式", 'get_pay_way', '*'), array('pay_way', "充值方式", 'get_pay_way', '*'),
array('pay_ip', "充值ip"), array('pay_ip', "充值ip"),
array('create_time', "充值时间"), array('create_time', "充值时间"),
array('pay_status', L('Order_status'), 'get_info_status', '*', '9'), array('pay_status', L('Order_status'), 'get_info_status', '*', '9'),
array('', "共计充值{$total}"), array('', "共计充值{$total}"),
); );
$xlsData = D('Deposit') $xlsData = D('Deposit')
->where($map) ->where($map)
->order('id DESC') ->order('id DESC')
->select(); ->select();
foreach ($xlsData as $key => $value) { foreach ($xlsData as $key => $value) {
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']); $xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
}
} }
// dd($xlsData); // dd($xlsData);
break; break;

@ -78,21 +78,21 @@
</select> </select>
</div> </div>
<!-- <div class="input-list search_item input-list-gamenoticestatus">--> <div class="input-list search_item input-list-gamenoticestatus">
<!-- <select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">--> <select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<!-- <option value="">请选择推广员等级</option>--> <option value="">请选择推广员等级</option>
<!-- <option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>--> <option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>
<!-- <option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>--> <option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>
<!-- <option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>--> <option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>
<!-- <option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>--> <option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>
<!-- </select>--> </select>
<!-- - --> -
<!-- </div>--> </div>
<!-- <div class="input-list search_item input-list-gamenoticestatus">--> <div class="input-list search_item input-list-gamenoticestatus">
<!-- <select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">--> <select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">
<!-- <option value="">请选择推广员</option>--> <option value="">请选择推广员</option>
<!-- </select>--> </select>
<!-- </div>--> </div>
<input type="hidden" name="" value="" class="sortBy"> <input type="hidden" name="" value="" class="sortBy">
<div class="input-list"> <div class="input-list">
@ -112,7 +112,7 @@
<thead> <thead>
<tr> <tr>
<th>订单号</th> <th>订单号</th>
<th>玩家账号</th> <if condition="$_REQUEST['promote_id'] eq ''"><th>玩家账号</th></if>
<th>所属推广员</th> <th>所属推广员</th>
<th> <th>
<a class="paixu" data-order='pay_amount'> <a class="paixu" data-order='pay_amount'>
@ -120,14 +120,14 @@
</a> </a>
</th> </th>
<th>充值方式</th> <th>充值方式</th>
<th>充值ip</th> <if condition="$_REQUEST['promote_id'] eq ''"><th>充值ip</th></if>
<th> <th>
<a class="paixu" data-order='create_time'> <a class="paixu" data-order='create_time'>
充值时间 充值时间
</a> </a>
</th> </th>
<th>订单状态</th> <th>订单状态</th>
<th>操作</th> <if condition="$_REQUEST['promote_id'] eq ''"><th>操作</th></if>
</tr> </tr>
</thead> </thead>
@ -138,14 +138,14 @@
<else /> <else />
<volist name="list_data" id="data"> <volist name="list_data" id="data">
<tr> <tr>
<td>{:$data['pay_order_number']}</td> <td><if condition="$data['pay_order_number'] neq ''">{:$data['pay_order_number']}<else/></if></td>
<td> <if condition="$_REQUEST['promote_id'] eq ''"><td>
<if condition="$is_admin eq true "> <if condition="$is_admin eq true ">
{$data.user_account} {$data.user_account}
<else /> <else />
{$data.user_account|encryptStr} {$data.user_account|encryptStr}
</if> </if>
</td> </td></if>
<td> <td>
<if condition="$data['promote_account'] eq '自然注册'"> <if condition="$data['promote_account'] eq '自然注册'">
官方渠道 官方渠道
@ -159,8 +159,8 @@
</if> </if>
</td> </td>
<td><span>{$data.pay_amount}</span></td> <td><span>{$data.pay_amount}</span></td>
<td>{:get_pay_way($data['pay_way'])}</td> <td><if condition="$data['pay_way'] neq ''">{:get_pay_way($data['pay_way'])}<else/></if></td>
<td>{$data.pay_ip}</td> <if condition="$_REQUEST['promote_id'] eq ''"><td>{$data.pay_ip}</td></if>
<td>{:set_show_time($data['create_time'],'','pay')}</td> <td>{:set_show_time($data['create_time'],'','pay')}</td>
<td> <td>
<if condition="$data['pay_status'] eq 1"> <if condition="$data['pay_status'] eq 1">
@ -169,15 +169,15 @@
{:get_info_status($data['pay_status'],9)} {:get_info_status($data['pay_status'],9)}
</if> </if>
</td> </td>
<td style="text-indent:0;"> <if condition="$_REQUEST['promote_id'] eq ''"><td style="text-indent:0;">
<br /> <br />
<if condition="$data['pay_status'] eq 0"> <if condition="$data['pay_status'] eq 0">
<a class="pay_repair" href="javascript:void(0);" <a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a> href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if> </if>
</td> </td></if>
</tr> </tr>
</volist> </volist>

Loading…
Cancel
Save