Job owner id

This commit is contained in:
CHIEFSOFT\ameye
2023-05-28 19:39:11 -04:00
parent 9099e17d6b
commit 32c1d0ee5e
+4 -2
View File
@@ -532,6 +532,7 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
long offer_result = REQ_LONG(in, "offer_result", 1, -1);
REQ_STRING(in, "offer_code", 1, 15, "(.*)");
long job_id = 0;
long owner_member_id = 0;
long rc = 0;
CVars outx;
@@ -539,7 +540,7 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
const PGresult *res = pgsql_query("SELECT * FROM members_jobs_offer WHERE offer_code='%s' AND status = 1", in["offer_code"].c_str());
const PGresult *res = pgsql_query("SELECT *,member_id AS owner_member_id FROM members_jobs_offer WHERE offer_code='%s' AND status = 1", in["offer_code"].c_str());
if (res != NULL && pgsql_num_rows(res) > 0) {
// now job is valid
@@ -549,6 +550,7 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
CVars rec;
map_to_cvars(f, rec);
job_id = rec["job_id"];
owner_member_id = rec["owner_member_id"];
}
if( offer_result == OFFER_RESEND){
@@ -592,7 +594,7 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
x["job_id"].set_valid(true);
x["contract"] = in["offer_code"];
x["contract"].set_valid(true);
x["member_id"] = out["owner_member_id"];
x["member_id"] = owner_member_id; //out["owner_member_id"];
x["member_id"].set_valid(true); // this is the owner of the job - from job database read
x["client_id"] = in["member_id"];
x["client_id"].set_valid(true); // be care full, you are the client accepting job