优化支付订单查看,默认支付成功

master
chenzhi 3 years ago
parent 6d700a6692
commit 08f4769c58

@ -1084,10 +1084,18 @@ class ExportController extends Controller
case 7:
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
$payStatus = isset($_REQUEST['pay_status']) ? $_REQUEST['pay_status'] : 1;
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
if($payStatus > 0){
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
}else{
$map['spend_time'] = array('BETWEEN', array($startTime, $endTime));
}
$map['pay_status'] = $payStatus;
$is_sub_data = I("issubdata",0);
if($is_sub_data == 1){
$SpendModel = M("spend","tab_",SUBSITE_DB);
@ -1129,10 +1137,7 @@ class ExportController extends Controller
$map['extend'] = array('like', trim($_REQUEST['extend']));
unset($_REQUEST['extend']);
}
if (isset($_REQUEST['pay_status'])) {
$map['pay_status'] = $_REQUEST['pay_status'];
unset($_REQUEST['pay_status']);
}
if (isset($_REQUEST['pay_way'])) {
if ($_REQUEST['pay_way'] == 2) {
$map['pay_way'] = ['in', '2,3,4'];
@ -1205,9 +1210,11 @@ class ExportController extends Controller
// $map1 = $map;
// }
D("Spend")->addSubsiteWhere($map);
if($payStatus > 0){
$map1 = $map;
$map1['pay_status'] = 1;
$total = $SpendModel->where($map1)->sum('pay_amount');
}
// var_dump($total);die();
$total=$total?$total:0;
@ -1253,6 +1260,7 @@ class ExportController extends Controller
$xlsCell = array_values($headers);
$fields = array_keys($headers);
$fields[] = "spend_time";
// ----获取游戏的基本信息begin
//获取游戏公司
$cpCompanyDb = M("partner","tab_")->field("id,partner")->order("id asc")->select();
@ -1313,6 +1321,9 @@ class ExportController extends Controller
foreach($xlsData as $value) {
//游戏信息匹配
if(!$value['pay_time']) $value['pay_time'] = $value['spend_time'];
unset($value['spend_time']);
$thisGameInfo = $gameInfo[$value["game_id"]];
$value['game_name'] =$thisGameInfo['relation_game_name'];
$value['sdk_version'] = $value['sdk_version'] == 1 ? "安卓" : "苹果";

@ -17,10 +17,18 @@ class SpendController extends ThinkController
{
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
$payStatus = isset($_REQUEST['pay_status']) ? $_REQUEST['pay_status'] : 1;
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
if($payStatus > 0){
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
}else{
$map['spend_time'] = array('BETWEEN', array($startTime, $endTime));
}
$map['pay_status'] = $payStatus;
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
@ -64,10 +72,7 @@ class SpendController extends ThinkController
$map['extend'] = array('like', trim($_REQUEST['extend']));
unset($_REQUEST['extend']);
}
if (isset($_REQUEST['pay_status'])) {
$map['pay_status'] = $_REQUEST['pay_status'];
unset($_REQUEST['pay_status']);
}
if (isset($_REQUEST['pay_way'])) {
if ($_REQUEST['pay_way'] == 2) {
$map['pay_way'] = ['in', '2,3,4'];
@ -155,6 +160,7 @@ class SpendController extends ThinkController
$game_arr = explode("(", rtrim($value['game_name'], ")"));
$value['game_name'] = $game_arr[0];
$value['sdk_version_name'] = $game_arr[1];
if(!$value['pay_time']) $value['pay_time'] = $value['spend_time'];
}
}
@ -168,6 +174,7 @@ class SpendController extends ThinkController
$this->assign('marketAdmins', getMarketAdmins());
$this->assign('startDate', $startDate);
$this->assign('endDate', $endDate);
$this->assign('payStatus', $payStatus);
$this->assign('list_data', $data['data']);
$this->assign('_page', $data['page']);
$show_data_power = (is_administrator()|| session('user_auth')['show_data']);

@ -124,9 +124,9 @@
</div>
<div class="input-list search_item input-list-orderstatus">
<select name="pay_status" style="color:#444" class="select_gallery" id="sel_order">
<option value="">订单状态</option>
<option value="1">充值成功</option>
<option value="0">下单未付款</option>
<!-- <option value="">订单状态</option> -->
<option value="1" <?php echo $payStatus == 1 ? "selected" : ''?>>充值成功</option>
<option value="0" <?php echo $payStatus == 0 ? "selected" : ''?>>下单未付款</option>
</select>
</div>
<div class="input-list">

Loading…
Cancel
Save