|
|
@ -630,14 +630,18 @@ class BaseController extends RestController{
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*消费表添加数据
|
|
|
|
*消费表添加数据
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function add_spend($data,$type=0){
|
|
|
|
public function add_spend($data,$type=0,$api_ver=2){
|
|
|
|
$spend = M("spend","tab_");
|
|
|
|
$spend = M("spend","tab_");
|
|
|
|
$spend_data = $this->spend_param($data);
|
|
|
|
$spend_data = $this->spend_param($data);
|
|
|
|
$ordercheck = $spend->where(array('pay_order_number'=>$spend_data["pay_order_number"]))->find();
|
|
|
|
$ordercheck = $spend->where(array('pay_order_number'=>$spend_data["pay_order_number"]))->find();
|
|
|
|
if($ordercheck)
|
|
|
|
if($ordercheck)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if($type==1){
|
|
|
|
if($type==1){
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$ordercheck['user_id'],'game_id'=>$ordercheck['game_id'],'msg'=>'订单已经存在,请刷新充值页面重新下单!')));exit;
|
|
|
|
if ($api_ver == 0) {
|
|
|
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$ordercheck['user_id'],'game_id'=>$ordercheck['game_id'],'msg'=>'订单已经存在,请刷新充值页面重新下单!')));exit;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$ordercheck['user_id'],'game_id'=>$ordercheck['game_id'],'msg'=>'订单已经存在,请刷新充值页面重新下单!')));exit;
|
|
|
|
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$this->set_message(0,'fail',"订单已经存在,请刷新充值页面重新下单!");
|
|
|
|
$this->set_message(0,'fail',"订单已经存在,请刷新充值页面重新下单!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|