From 8d1a22cfa4c9ab7943c0bc342976da38f384d092 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 1 Aug 2025 18:57:47 -0400 Subject: [PATCH] notification on interest --- wrenchboard/src/shared_tool/jobs.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/wrenchboard/src/shared_tool/jobs.cc b/wrenchboard/src/shared_tool/jobs.cc index d8fed573..d3508222 100644 --- a/wrenchboard/src/shared_tool/jobs.cc +++ b/wrenchboard/src/shared_tool/jobs.cc @@ -1007,7 +1007,9 @@ long WrenchJobsOfferInterest(CVars in, CVars &out) { REQ_LONG(in, "member_id", 1, -1); REQ_STRING(in, "offer_code", 1, 15, "(.*)"); //offer_code - const PGresult *res = pgsql_query("SELECT *,id as offer_id FROM members_jobs_offer WHERE offer_code ='%s' AND expire>= now() AND status = 1 AND public_view > 0", in["offer_code"].c_str()); + const PGresult *res = pgsql_query("SELECT *,id as offer_id, member_id AS job_owner_member_id FROM members_jobs_offer WHERE offer_code ='%s' " + " AND expire>= now() AND status = 1 " + " AND public_view > 0", in["offer_code"].c_str()); if (res != NULL && pgsql_num_rows(res) > 0) { mapf = pgsql_fetch_assoc(res, 0); if (!f.empty()) { @@ -1020,7 +1022,8 @@ long WrenchJobsOfferInterest(CVars in, CVars &out) { return ret; } - const PGresult *res1 = pgsql_query("SELECT * FROM members_offer_interest WHERE offer_id =%lu AND member_id = %lu AND status IN(1,5)", rec["offer_id"].Long(), in["member_id"].Long()); + const PGresult *res1 = pgsql_query("SELECT * FROM members_offer_interest WHERE offer_id =%lu AND member_id = %lu " + " AND status IN(1,5)", rec["offer_id"].Long(), in["member_id"].Long()); if (res1 != NULL && pgsql_num_rows(res1) > 0) { out["status"] = "You have sent or completed a request for this task already."; return ret; @@ -1039,6 +1042,14 @@ long WrenchJobsOfferInterest(CVars in, CVars &out) { x["interest_id"] = interest_id; x["interest_id"].set_valid(true); job_email(JOBS_OFFER_INTEREST_MAIL, x, out); // note I need interest_id to + + CVars xy; + if ( load_db_record(xy, "SELECT id AS member_id, uid AS member_uid, 'message.svg' AS icon " + " FROM members WHERE id = %lu ",rec["job_owner_member_id"].Long()) > 0 ){ + xy["msg"] = "You have received an interest in your task !!!"; + xy["msg"].set_valid(true); + plan_notification(xy, out); + } } } }