diff --git a/wrenchboard/src/shared_tool/jobs.cc b/wrenchboard/src/shared_tool/jobs.cc index e693fce5..4a80b7a3 100644 --- a/wrenchboard/src/shared_tool/jobs.cc +++ b/wrenchboard/src/shared_tool/jobs.cc @@ -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