From 1a545646b70eadd7cf6fcce08d48d5a5bb6ab2f1 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 23 Nov 2024 12:31:56 -0500 Subject: [PATCH] promo action --- wrenchboard/src/shared_tool/site_crons.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/wrenchboard/src/shared_tool/site_crons.cc b/wrenchboard/src/shared_tool/site_crons.cc index c1c6c51e..9fb68525 100644 --- a/wrenchboard/src/shared_tool/site_crons.cc +++ b/wrenchboard/src/shared_tool/site_crons.cc @@ -293,11 +293,25 @@ long RegisterPromoPoint(CVars in){ } long RegisterPromoAction(CVars in){ + long ret = PHP_API_BAD_PARAM; + CVars xx; + try { + long blog_id = REQ_LONG(in, "blog_id", 1, -1); + REQ_STRING (in, "category", 5, 49, "(.*)"); + REQ_STRING (in, "description", 5, 149, "(.*)"); + long admin_id = REQ_LONG(in, "admin_id", 1, -1); + xx["category"] = in["category"]; xx["category"].set_valid( true ); + xx["description"] = in["description"]; xx["description"].set_valid( true ); + xx["admin_id"] = in["admin_id"]; xx["admin_id"].set_valid( true ); + insert_db_record(DBS_VALID, "promo_actions", "promo_actions_id_seq", xx); - - - return 0; + ret = PHP_API_OK; + out["status"] = "OK"; + } catch (bad_parameter) { + logfmt(logINFO, "ERROR CALL long RegisterPromoAction(CVars in, CVars &out)"); + } + return ret; } long RefreshBlogs(CVars in, CVars &out){