diff --git a/wrenchboard/src/shared_tool/site_crons.cc b/wrenchboard/src/shared_tool/site_crons.cc index f72d1316..dad3576b 100644 --- a/wrenchboard/src/shared_tool/site_crons.cc +++ b/wrenchboard/src/shared_tool/site_crons.cc @@ -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++) { + mapf = 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; }