This commit is contained in:
2022-08-21 20:21:06 -04:00
parent ae25b88a68
commit 43c192aab0
3 changed files with 22 additions and 10 deletions
+14
View File
@@ -372,6 +372,18 @@ 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
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
out["result"] = "OK";
}
return PHP_CREATED_OK;
}
load_db_record(out, "SELECT jo.member_id AS owner_member_id,jo.id AS offer_id, j.id AS job_id,jo.added::date AS added_date,j.title,j.description, j.timeline_days, j.price,jo.offer_code,jo.job_description,jo.expire FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id WHERE jo.expire > now() AND jo.status = 1 AND jo.client_id = %lu AND jo.offer_code='%s'", in["member_id"].Long(), in["offer_code"].c_str());
@@ -392,6 +404,8 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
break;
case OFFER_SENDTOME:
job_email(JOBS_OFFER_SENDTOME_MAIL, in, out); // the email will come from
break;