From cbace4b29d0283b684551b52521c536d258043ed Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Mon, 30 Oct 2023 10:56:22 -0400 Subject: [PATCH] fix titile --- wrenchboard/src/shared_tool/payments.cc | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/wrenchboard/src/shared_tool/payments.cc b/wrenchboard/src/shared_tool/payments.cc index c6543ebc..4da776b9 100644 --- a/wrenchboard/src/shared_tool/payments.cc +++ b/wrenchboard/src/shared_tool/payments.cc @@ -274,20 +274,23 @@ long WrenchFamilyTransferCredit( CVars in, CVars &out ){ pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id ); pgsql_exec("UPDATE family_transfer SET credit_confirm = '%s' WHERE id = %lu ",confirmation, transfer_id ); CVars xrx; - load_db_record( out, "SELECT f.id AS transfer_id, f.*, " + if ( load_db_record( out, "SELECT f.id AS transfer_id, f.*, " " f.amount*0.01||'('||f.currency||') Reward sent to '||m.firstname AS title, " - " m.firstname FROM family_transfer f LEFT JOIN members m ON m.id = f.recipient WHERE f.id = %lu ", transfer_id ); - out["status"] = "OK"; - out["status_message"] = "trasnfer_completed"; - ret = PHP_API_OK; + " m.firstname FROM family_transfer f LEFT JOIN members m ON m.id = f.recipient WHERE f.id = %lu ", transfer_id )> 0 ){ + + out["status"] = "OK"; + out["status_message"] = "trasnfer_completed"; + ret = PHP_API_OK; + + CVars xxx, yy; + // char title[90]; + xxx["member_id"] = in["member_id"]; xxx["member_id"].set_valid( true ); // for the original sender + // snprintf(title, sizeof (title), "%lu(%s) Reward sent to %s",out["amount"].Long()*0.01,out["currency"].c_str(), out["firstname"].c_str()); + xxx["title"] = out["title"]; xxx["title"].set_valid( true ); + xxx["description"] = out["description"]; xxx["description"].set_valid( true ); + WrenchLogRecent(xxx, yy); + } - CVars xxx, yy; - char title[90]; - xxx["member_id"] = in["member_id"]; xxx["member_id"].set_valid( true ); // for the original sender - snprintf(title, sizeof (title), "%lu(%s) Reward sent to %s",out["amount"].Long()*0.01,out["currency"].c_str(), out["firstname"].c_str()); - xxx["title"] = out["title"]; xxx["title"].set_valid( true ); - xxx["description"] = out["description"]; xxx["description"].set_valid( true ); - WrenchLogRecent(xxx, yy); } else { out["status"] = "Unable to create payment";