|
|
@ -47,7 +47,7 @@ class TestOrderController extends ThinkController
|
|
|
|
$timeend = strtotime($_REQUEST['timeend'])+86399;
|
|
|
|
$timeend = strtotime($_REQUEST['timeend'])+86399;
|
|
|
|
$map['pay_time'] = array("ELT",$timeend);
|
|
|
|
$map['pay_time'] = array("ELT",$timeend);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$order_list = M('test_order', 'tab_')->where($map)->page($page,$row)->select();
|
|
|
|
$order_list = M('test_order', 'tab_')->where($map)->page($page,$row)->order('add_time desc')->select();
|
|
|
|
$sum_order_amount = M('test_order', 'tab_')->where($map)->field('sum(order_amount) as sum_order_amount,count(1) as count')->find();
|
|
|
|
$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();
|
|
|
|
$sum_pay_amount = M('test_order', 'tab_')->where($map)->field('sum(pay_amount) as sum_order_amount')->find();
|
|
|
|
|
|
|
|
|
|
|
@ -76,12 +76,18 @@ class TestOrderController extends ThinkController
|
|
|
|
$data['pay_time'] = strtotime($data['pay_time']);
|
|
|
|
$data['pay_time'] = strtotime($data['pay_time']);
|
|
|
|
$data['game_name'] = get_gamename($data['game_id']);
|
|
|
|
$data['game_name'] = get_gamename($data['game_id']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$is_exist = M('test_order','tab_')->where(['order_no'=>$data['order_no'],'cp_order_no'=>$data['cp_order_no']])->find();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($is_exist) {
|
|
|
|
|
|
|
|
$this->ajaxReturn(['status'=>0,'msg'=>'订单重复录入']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$isSuccess = M('test_order','tab_')->add($data);
|
|
|
|
$isSuccess = M('test_order','tab_')->add($data);
|
|
|
|
|
|
|
|
|
|
|
|
if ($isSuccess) {
|
|
|
|
if ($isSuccess) {
|
|
|
|
$this->ajaxReturn(['status'=>1]);
|
|
|
|
$this->ajaxReturn(['status'=>1,'msg'=>'订单录入成功']);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->ajaxReturn(['status'=>0]);
|
|
|
|
$this->ajaxReturn(['status'=>0,'msg'=>'订单录入失败']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|