<?php if(!defined('ONGPHP'))exit('Error ONGSOFT');



//$cip = $_SERVER["REMOTE_ADDR"];
//
//if($cip != '114.55.26.57'){
//
//    exit('fuckyou');
//
//}
plus(array('p','jiami','jianli','mima','shanchu','qcurl','qfopen','x','memcc','txtcc','db','isutf8','setsession','pagec','pinyin','ip','post','funciton','tcpcc','mongodbcc','vcode','ipdiqu','update','route','sslget','sslpost'));
$Memsession =  $Mem = new txtcc();
$D = db('');
//$ids = $_POST['orderids'];

//var_dump($_POST);exit;
$ids = $_POST;
if(empty($ids)){
     
    exit;
     
}

foreach($ids as $value){
     
    //$idname = explode('_',$value);
    $where = array(

        'orderid'=>$value,
        //'iskaijiang' =>1
    );
     
    $result = $D->setbiao('goumaika')->where($where)->find();
     
	 $JINE = (float)$result['jine'];
	 
    $where11 = array(

        'uid'=>$result['uid'],
        //'iskaijiang' =>1
    );

    $user = $D->setbiao('user')->where($where11)->find();
     
    if($result['status']== 0){
         
        $updateinfo['status'] = 1;//已经兑换游戏币
        $updateinfo['uptime'] = time();//寄售成功时间
		
        $result = $D->setbiao('goumaika')->where($where)->update($updateinfo);
         
         
         
        //给用户加钱
        $qian = jiaqian( $user['uid'] , $TYPE = 7 , $JINE ,$JIFEN = 0 , $HUOBI = 0  , $DATA = '兑换返回游戏币' , $ip = ip());//7是寄售

        if(!$qian){
             
            echo "false";
            die();
             
        }
         
    }
}
 

echo 'success';

