$ddInfo=$db->get_one("select a.*, c.company_name, c.wxpay_key from tb_recharge_pay_weixin a, tb_user b, tb_company c where a.uid=b.id and b.company_id=c.id and a.code = '{$out_trade_no}'");
$db->query("insert into tb_recharge_pay_weixin_recv set bank_type='".$data['bank_type']."',cash_fee='".$data['cash_fee']."',fee_type='".$data['fee_type']."',is_subscribe='".$data['is_subscribe']."',openid='".$data['openid']."',out_trade_no='".$data['out_trade_no']."',result_code='".$data['result_code']."',return_code='".$data['return_code']."',sign='".$data['sign']."',time_end='".$data['time_end']."',total_fee='".$data['total_fee']."',trade_type='".$data['trade_type']."',transaction_id='".$data['transaction_id']."',trade_state='".$data['trade_state']."',trade_state_desc='".addslashes($data['trade_state_desc'])."',err_code='".$data['err_code']."',err_code_des='".$data['err_code_des']."',addtime=now()");
$sign=$data['sign'];
if(!$sign)exit;
unset($data['sign']);
ksort($data);
$s1='';
foreach($dataas$key=>$item){
if($item!=''){
if($s1!='')$s1.="&";
$s1.=$key."=".$item;
}
}
$s=$s1."&key=".$wxpay_key;
$sign2=strtoupper(md5($s));
if($sign!=$sign2)exit;
$code=$data['out_trade_no'];
$orderInfo=$db->get_one("select * from tb_recharge_pay_weixin where code = '{$code}'");