From c5af776524b138cc21441f83b70961d8cbd70512 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Mon, 2 Dec 2024 13:43:06 -0500 Subject: [PATCH] ref link --- wrenchboard/src/shared_tool/account_mngt.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wrenchboard/src/shared_tool/account_mngt.cc b/wrenchboard/src/shared_tool/account_mngt.cc index f256e3a2..0ea950c5 100644 --- a/wrenchboard/src/shared_tool/account_mngt.cc +++ b/wrenchboard/src/shared_tool/account_mngt.cc @@ -1158,6 +1158,7 @@ long CreateWrenchBoardAccount(CVars in, CVars &out) { long CreateWrenchBoardAccountPending(CVars in, CVars &out) { long ret = PHP_API_BAD_PARAM; out = in; + CVars y; try { @@ -1234,8 +1235,8 @@ long CreateWrenchBoardAccountPending(CVars in, CVars &out) { x["email"].set_valid(true); x["phone"] = in["phone"]; x["phone"].set_valid(true); - x["country"] = in["country"]; - x["country"].set_valid(true); + x["country"] = in["country"]; x["country"].set_valid(true); + x["refer_link"] = in["refer_link"]; x["refer_link"].set_valid(true); if (in["loc"].length() > 0) x["loc"] = in["loc"]; x["loc"].set_valid(true); @@ -1252,8 +1253,13 @@ long CreateWrenchBoardAccountPending(CVars in, CVars &out) { if (ret > 0) { pgsql_query("UPDATE members_pending SET password = md5('%s'),signup_random=%lu WHERE id = %lu", in["password"].c_str(),signup_random/1000, ret); pgsql_query("UPDATE members_refer_friend SET status = 5 WHERE status = 1 AND email = '%s'", x["email"].c_str()); + load_db_record(out, "SELECT *,id AS pending_id FROM members_pending WHERE id=%lu LIMIT 1", ret); - load_db_record(out, "SELECT *,id AS pending_id FROM members_pending WHERE id=%lu LIMIT 1", ret); + if ( in["refer_link"] !=""){ + y["email"] = in["email"]; y["email"].set_valid(true); + y["refer_link"] = in["refer_link"]; y["refer_link"].set_valid(true); + insert_db_record(DBS_VALID, "referlink_signup", "referlink_signup_id_seq", y); + } } if (ret > 0) {