promo monitor emsil

This commit is contained in:
CHIEFSOFT\ameye
2024-11-23 10:15:21 -05:00
parent 73dedf0513
commit 9b066a554b
3 changed files with 45 additions and 0 deletions
+17
View File
@@ -212,6 +212,23 @@ long RefreshPromoActivities(CVars in, CVars &out){
}
}
res = pgsql_query("SELECT * FROM promo_admin WHERE status = 1 ORDER BY updated ASC LIMIT 20");
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
promo_email(WRB_CRONJOB_PROCESS_PROMO, rec, out); // send the reminder email
pgsql_query("UPDATE promo_admin SET updated = now() WHERE id = %lu ", rec["id"].Long()); // mo
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {