сумма всех выводов пользователя
$sum = RQ::tbl(new MW_Request())->select(['output_rq'])->where(['user_id' => $user_id])->get_sum();
сумма всех приходов от партнерской программы (потребуется обновить дополнение до версии 1.17.1)
$sum = RQ::tbl(new PS_Inc_Query())->select(['size_inc'])->where(['partner' => $user_id])->get_sum();
Aug 30 19:48:12 vh201 apache_error: winners.alexanderzhukov.pro [Sun Aug 30 19:48:12 2020] [error] [pid 6888] sapi_apache2.c(362): [client 46.119.196.186:40122] PHP Fatal error: Uncaught Error: Class 'RQ' not found in /home/c/cj04754/winners/public_html/wp-content/themes/Winners_Club/template-referral.php:152nStack trace:n#0 /home/c/cj04754/winners/public_html/wp-includes/template-loader.php(106): include()n#1 /home/c/cj04754/winners/public_html/wp-blog-header.php(19): require_once('/home/c/cj04754...')n#2 /home/c/cj04754/winners/public_html/index.php(17): require('/home/c/cj04754...')n#3 {main}n thrown in /home/c/cj04754/winners/public_html/wp-content/themes/Winners_Club/template-referral.php on line 152