escow calculation
This commit is contained in:
@@ -1175,8 +1175,17 @@ long WrenchBoardMobileSendUserWallet(CVars in, CVars &out) {
|
||||
}
|
||||
|
||||
const PGresult *res2;
|
||||
res2 = pgsql_query("SELECT sum(amount) AS escrow,currency FROM members_payments WHERE code ='OFDPS' AND member_id = %lu "
|
||||
"AND confirmation IS NOT NULL AND flags = 4 GROUP BY currency", in["member_id"].Long());
|
||||
// res2 = pgsql_query("SELECT sum(amount) AS escrow,currency FROM members_payments WHERE code ='OFDPS' AND member_id = %lu "
|
||||
// "AND confirmation IS NOT NULL AND flags = 4 GROUP BY currency", in["member_id"].Long());
|
||||
|
||||
res2 = pgsql_query("SELECT sum(p.amount) AS escrow,p.currency "
|
||||
" FROM members_payments p "
|
||||
" LEFT JOIN members_jobs_offer o ON o.payment_id = p.id "
|
||||
" WHERE p.code ='OFDPS' AND p.member_id = %lu "
|
||||
" AND p.confirmation IS NOT NULL "
|
||||
" AND p.flags = 4 AND o.status=1 "
|
||||
" GROUP BY p.currency" in["member_id"].Long());
|
||||
|
||||
|
||||
if (res2 != NULL && pgsql_num_rows(res2) > 0) {
|
||||
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||
|
||||
Reference in New Issue
Block a user