This commit is contained in:
CHIEFSOFT\ameye
2024-11-20 06:43:46 -05:00
parent 39be594de8
commit a1678ab730
+22
View File
@@ -194,8 +194,30 @@ long sitecrons_calls(CVars in, CVars &out) {
return ret;
}
long RefreshPromoActivities(CVars in, CVars &out){
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT * FROM promo_member WHERE status = 1 ORDER BY id DESC 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);
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long ScheduleHolidayJobs(CVars in, CVars &out)");
}
logfmt(logINFO, "/RefreshPromoActivities()");
return ret;
}