From fe5ec7239c1a15112c623bcd90aaf262848e989e Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 27 Oct 2023 11:54:44 -0400 Subject: [PATCH] start trsnafer --- wrenchboard/src/shared_tool/family_acc.cc | 41 +++-------------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/wrenchboard/src/shared_tool/family_acc.cc b/wrenchboard/src/shared_tool/family_acc.cc index 03f3030c..258fbdfb 100644 --- a/wrenchboard/src/shared_tool/family_acc.cc +++ b/wrenchboard/src/shared_tool/family_acc.cc @@ -423,54 +423,23 @@ long WrenchFamilyTransferStart(CVars in, CVars &out){ return 0; } - - out["total_record"] = "0"; const PGresult *res; - res = pgsql_query("SELECT w.amount,c.*,w.amount AS current_balance,c.country,w.transfer_limit,w.uid AS wallet_uid " + res = pgsql_query("SELECT w.amount AS current_balance, w.currency, w.uid AS recipient_wallet_uid " "FROM members_wallet w LEFT JOIN currency c ON c.code=w.currency " "WHERE w.member_id = %lu AND w.uid='%s' ORDER BY c.lorder DESC", rec0["family_member_id"].Long(), in["wallet_uid"].c_str()); if (res != NULL && pgsql_num_rows(res) > 0) { out["total_record"] = pgsql_num_rows(res); - // for (int i = 0, n = pgsql_num_rows(res); i < n; i++) { mapf = pgsql_fetch_assoc(res, 0); - if (f.empty()) continue; CVars rec; map_to_cvars(f, rec); - out = rec; - -// snprintf(vname, sizeof (vname), "amount_%05d", i); -// out[vname] = rec["amount"]; -// snprintf(vname, sizeof (vname), "currency_%05d", i); -// out[vname] = rec["currency"]; -// -// // amount | id | code | description | symbol | action_type | lorder | current_balance -// snprintf(vname, sizeof (vname), "description_%05d", i); -// out[vname] = rec["description"]; -// -// snprintf(vname, sizeof (vname), "symbol_%05d", i); -// out[vname] = rec["symbol"]; -// -// snprintf(vname, sizeof (vname), "action_type_%05d", i); -// out[vname] = rec["action_type"]; -// -// snprintf(vname, sizeof (vname), "code_%05d", i); -// out[vname] = rec["code"]; -// -// snprintf(vname, sizeof (vname), "country_%05d", i); -// out[vname] = rec["country"]; -// -// snprintf(vname, sizeof (vname), "transfer_limit_%05d", i); -// out[vname] = rec["transfer_limit"]; -// -// snprintf(vname, sizeof (vname), "wallet_uid_%05d", i); -// out[vname] = rec["wallet_uid"]; - - - // } + // lets get the parent wallet too + load_db_record(out,"SELECT w.amount AS origing_current_balance,w.uid AS origing_wallet_uid,w.transfer_limit AS origing_transfer_limit " + "FROM members_wallet w " + "WHERE w.member_id = %lu AND w.currency='%s' ORDER BY c.lorder DESC", in["member_id"].Long(), out["currency"].c_str()); } ret = PHP_API_OK; out["status"] = "OK";