This commit is contained in:
CHIEFSOFT\ameye
2023-05-28 19:15:28 -04:00
parent ef44482144
commit 9099e17d6b
+12 -3
View File
@@ -531,6 +531,7 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
REQ_LONG(in, "member_id", 1, -1);
long offer_result = REQ_LONG(in, "offer_result", 1, -1);
REQ_STRING(in, "offer_code", 1, 15, "(.*)");
long job_id = 0;
long rc = 0;
CVars outx;
@@ -540,8 +541,16 @@ 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());
if (res != NULL && pgsql_num_rows(res) > 0) {
// now job is valid
// now job is valid
// good to continue
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
if (!f.empty()) {
CVars rec;
map_to_cvars(f, rec);
job_id = rec["job_id"];
}
if( offer_result == OFFER_RESEND){
if (load_db_record(outx, "SELECT o.id AS offer_id, o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.offer_code='%s' AND o.email IS NOT NULL", in["offer_code"].c_str())) {
job_email(JOBS_INDIVIDUAL_OFFER_MAIL, outx, out); // make sure job went to individual
@@ -579,7 +588,7 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
break;
case OFFER_ACCEPT:
x["job_id"] = out["job_id"];
x["job_id"] = job_id;
x["job_id"].set_valid(true);
x["contract"] = in["offer_code"];
x["contract"].set_valid(true);