|
|
@ -36,10 +36,30 @@ class TestOrderController extends ThinkController
|
|
|
|
if (!empty($_REQUEST['pay_way'])) {
|
|
|
|
if (!empty($_REQUEST['pay_way'])) {
|
|
|
|
$map['pay_way'] = $_REQUEST['pay_way'];
|
|
|
|
$map['pay_way'] = $_REQUEST['pay_way'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])){
|
|
|
|
|
|
|
|
$timestart = strtotime($_REQUEST['timestart']);
|
|
|
|
|
|
|
|
$timeend = strtotime($_REQUEST['timeend'])+86399;
|
|
|
|
|
|
|
|
$map['pay_time'] = array("between",array($timestart,$timeend));
|
|
|
|
|
|
|
|
}else if(!empty($_REQUEST['timestart']) && empty($_REQUEST['timeend'])) {
|
|
|
|
|
|
|
|
$timestart = strtotime($_REQUEST['timestart']);
|
|
|
|
|
|
|
|
$map['pay_time'] = array("EGT",$timestart);
|
|
|
|
|
|
|
|
}else if (!empty($_REQUEST['timeend']) && empty($_REQUEST['timestart'])) {
|
|
|
|
|
|
|
|
$timeend = strtotime($_REQUEST['timeend'])+86399;
|
|
|
|
|
|
|
|
$map['pay_time'] = array("ELT",$timeend);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$order_list = M('test_order', 'tab_')->where($map)->page($page,$row)->select();
|
|
|
|
|
|
|
|
$sum_order_amount = M('test_order', 'tab_')->where($map)->field('sum(order_amount) as sum_order_amount,count(1) as count')->find();
|
|
|
|
|
|
|
|
$sum_pay_amount = M('test_order', 'tab_')->where($map)->field('sum(pay_amount) as sum_order_amount')->find();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$count = $sum_order_amount['count'];
|
|
|
|
|
|
|
|
$page = set_pagination($count, $row);
|
|
|
|
|
|
|
|
if ($page) {
|
|
|
|
|
|
|
|
$this->assign('_page', $page);//分页
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$order_list = M('test_order', 'tab_')->where($map)->order('add_time desc')->select();
|
|
|
|
|
|
|
|
$this->assign('datas', $order_list);
|
|
|
|
$this->assign('datas', $order_list);
|
|
|
|
|
|
|
|
$this->assign('sum_order_amount', $sum_order_amount);
|
|
|
|
|
|
|
|
$this->assign('sum_pay_amount', $sum_pay_amount);
|
|
|
|
$this->display();
|
|
|
|
$this->display();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|