1 public function wx_notify(){ 2 $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; 3 libxml_disable_entity_loader(true); 4 $xml = json_decode(json_encode(simplexml_load_string($postStr, ‘SimpleXMLElement‘, LIBXML_NOCDATA)), true); 5 if($xml[‘out_trade_no‘]){ 6 $rs = Db::name(‘order_jiaoche‘)->where(array(‘order_sn‘=>$xml[‘out_trade_no‘]))->find(); 7 if($rs){ 8 Db::name(‘order_jiaoche‘)->where(array(‘order_sn‘=>$xml[‘out_trade_no‘]))->update(array(‘ispay‘=>1)); 9 echo ‘success‘; 10 } 11 } 12 /* 13 调试所用 14 $fp = fopen(‘notify.txt‘,‘a+‘); 15 fwrite($fp,"\n _______GET________"); 16 fwrite($fp,var_export($xml,true)); 17 fwrite($fp,"\n ________postObj________"); 18 fwrite($fp,var_export($xml,true)); 19 fwrite($fp,‘【 Now 】: ‘. date("Y-m-d H:i:s") ."\n"); 20 fclose($fp); 21 print_r($xml); 22 */ 23 }
原文地址:https://www.cnblogs.com/luojie-/p/11699718.html
时间: 2024-10-25 14:48:04