php notifyprocess 微信支付 回调函数 数据库更新语句 怎么写

2025-05-03 20:29:54
推荐回答(2个)
回答(1):

//重写回调处理函数
    public function NotifyProcess($data, &$msg)
    {
        Log::DEBUG("call back:" . json_encode($data));
        $notfiyOutput = array();
        
        if(!array_key_exists("transaction_id", $data)){
            $msg = "输入参数不正确";
            return false;
        }
         
        //查询订单,判断订单真实性
        if(!$this->Queryorder($data["transaction_id"])){
            $msg = "订单查询失败";
            return false;
        }
        $this->handel_order($data['out_trade_no'],$data['transaction_id']);
        return true;
    }
    //业务处理
    public function handel_order($order_sn,$out_trade_no){
        $arr = json_encode(array(
            'order_sn'      =>$order_sn,
            'out_trade_no'=>$out_trade_no,
        ));
        $url = getCurl('Wxpay/payComplete');
        $res = json_decode(https_request($url,$arr),true);
        if($res['status']==1) $this->Closeorder($order_sn);    //关闭订单
    }

回答(2):

看你的mysql当前默认的存储引擎:
mysql> show variables like '%storage_engine%';

你要看某个表用了什么引擎(在显示结果里参数engine后面的就表示该表当前用的存储引擎):
mysql> show create table 表名;