| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 862 人关注过本帖
标题:函数 wpdb::prepare 的调用方法不正确。 无效的值类型(object)
取消只看楼主 加入收藏
Hector0371
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2022-9-10
收藏
 问题点数:0 回复次数:0 
函数 wpdb::prepare 的调用方法不正确。 无效的值类型(object)
报错点在/wp-includes/functions.php on line 5831  。完整报错如下:

[10-Sep-2022 04:04:07 UTC] PHP Notice:  函数 wpdb::prepare 的调用方法<strong>不正确</strong>。 无效的值类型(object)。 请查阅<a href="https://调试WordPress</a>来获取更多信息。 (这个消息是在4.8.2版本添加的。) in /www/wwwroot/www. on line 5831
[10-Sep-2022 04:04:07 UTC] PHP Notice:  Undefined index: id in /www/wwwroot/www. on line 70

而wordpress的原始文件我没动。我是在自己的theme文件夹/functions.php里编辑的,完整的代码如下

 use WeDevs\Dokan\Withdraw;
    use WP_Error;
    use WeDevs\Dokan\Cache;      
    use WeDevs\Dokan;
    use WeDevs\Dokan\Withdraw\Withdraws;
           
    add_action( 'woocommerce_order_status_completed', 'Neo_friendsexchange_core', 99 );


    function Neo_friendsexchange_core($order_id) {
            
            global $wpdb;
            
            
         

         
    ///总纲:创建withdraw,执行withdraw,将vendorbalance转移给TeraWallet  method=》wallet,更新withdraw状态为完成,收尾

            
            
            $RootDir = rtrim(str_replace('\\','/', $_SERVER['DOCUMENT_ROOT']), '/');
            $fileDir=$RootDir . '/wp-content/plugins/dokan-lite/includes/Withdraw/Withdraw.php';
            require($fileDir);
            

                         $Neo_order = dokan()->order->get( $order_id );//wc_get_order( $order_id );
                        





                         $seller_id = dokan_get_seller_id_by_order($Neo_order); //$order
                         $amount = dokan_get_seller_balance( $seller_id, false );// 也许需要wc和DOkan之间的ID转变,也许需要add action
            
                        

                         $withdraw=new WeDevs\Dokan\Withdraw\Withdraw();
                        
                         $withdraw->save();  
                        

                         $withdraw->get_withdraw();
                         $withdraw->set_method('woo_wallet');
                         $withdraw->set_user_id($seller_id);
                        

                         $withdraw->set_amount($amount);
            
           
                         do_action( 'dokan_withdraw_created', $withdraw );   
                                                               

            
            
                          //To approve   
            
            
                         $withdraw->set_status( dokan()->withdraw->get_status_code( 'approved' ) );
            
            
                         do_action( 'dokan_withdraw_updated', $withdraw );// ?$withdraw

                       
                       
                        file_put_contents("./result.txt",var_export($wpdb->queries,true));
            
    }


            
            
            
     网上查不到报错方式,有哪位大佬愿意告诉我如何解决吗?十分感谢
            


 
搜索更多相关主题的帖子: php 类型 object 函数 方法 
2022-09-10 12:39
快速回复:函数 wpdb::prepare 的调用方法不正确。 无效的值类型(object)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.243651 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved