Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 如何计算woo commerce会员总数?_Wordpress_Woocommerce - Fatal编程技术网

Wordpress 如何计算woo commerce会员总数?

Wordpress 如何计算woo commerce会员总数?,wordpress,woocommerce,Wordpress,Woocommerce,我的网站上有WooCommerce插件和WooCommerce会员资格插件。我需要显示会员总数。我已经阅读了文档,但没有找到任何解决方案。因此,请对此提供帮助。获取激活会员计划的用户总数 使用还可以根据需要更改状态,并可以修改查询以获得适当的结果 function display_count() { global $wpdb; $result = $wpdb->get_results ("SELECT DISTINCT post_author FROM $wpdb->

我的网站上有WooCommerce插件和WooCommerce会员资格插件。我需要显示会员总数。我已经阅读了文档,但没有找到任何解决方案。因此,请对此提供帮助。

获取激活会员计划的用户总数

使用还可以根据需要更改状态,并可以修改查询以获得适当的结果

function display_count()
{
    global $wpdb;
    $result = $wpdb->get_results ("SELECT DISTINCT post_author FROM  $wpdb->posts WHERE post_status='wcm-active' and post_type='wc_user_membership'" );
    if($result)
        return count($result);
    return 0;
}

获取成员资格计划处于活动状态的用户总数

使用还可以根据需要更改状态,并可以修改查询以获得适当的结果

function display_count()
{
    global $wpdb;
    $result = $wpdb->get_results ("SELECT DISTINCT post_author FROM  $wpdb->posts WHERE post_status='wcm-active' and post_type='wc_user_membership'" );
    if($result)
        return count($result);
    return 0;
}