promo monitor emsil
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user