diff --git a/wrenchboard/src/shared_tool/site_crons.cc b/wrenchboard/src/shared_tool/site_crons.cc index 10476be5..f4cb2fc7 100644 --- a/wrenchboard/src/shared_tool/site_crons.cc +++ b/wrenchboard/src/shared_tool/site_crons.cc @@ -12,6 +12,7 @@ #include "cfg.h" #include #include "jobs.h" +#include "bko.h" long ReviewReminder(CVars in, CVars &out); long OfferPending(CVars in, CVars &out); @@ -106,12 +107,12 @@ long sitecrons_calls(CVars in, CVars &out) { long NotificationSystem(CVars in, CVars &out){ long ret = 0; - const PGresult *res; + //const PGresult *res; long limit = in["limit"].Long(); logfmt(logINFO, "ENTER NotificationSystem()"); long push_ret = -1; const PGresult *res = pgsql_query("SELECT count(member_uid) AS mcount,member_uid " - /* " FROM members_notification WHERE status=1 GROUP BY member_uid LIMIT %lu",limit); + " FROM members_notification WHERE status=1 GROUP BY member_uid LIMIT %lu",limit); if (res != NULL && pgsql_num_rows(res) > 0) { for (int i = 0, n = pgsql_num_rows(res); i < n; i++) { mapf = pgsql_fetch_assoc(res, i); @@ -139,7 +140,7 @@ long NotificationSystem(CVars in, CVars &out){ } } // for loopp } // main nserach - */ + return ret; } diff --git a/www-api/app/Controllers/WrenchCrons.php b/www-api/app/Controllers/WrenchCrons.php index e73f75d7..d3aa6b10 100644 --- a/www-api/app/Controllers/WrenchCrons.php +++ b/www-api/app/Controllers/WrenchCrons.php @@ -8,6 +8,7 @@ define('WRB_CRONJOB_SIGNUP_ALERT', 773); define('WRB_CRONJOB_PASTDUE_ALERT',774); define('WRB_CRONJOB_OFFER_REFUND_ALERT',775); define('WRB_CRONJOB_PENDOFFER_ALERT',776); +define('WRB_CRONJOB_NOTIFICATIONS', 777) ; class WrenchCrons extends BaseController { @@ -38,6 +39,10 @@ class WrenchCrons extends BaseController $wrenchboard = new \App\Models\BackendModel(); $out=[]; + $in['call_action'] = WRB_CRONJOB_NOTIFICATIONS; + $in['one_limit'] = 10; + $ret['WRB_CRONJOB_NOTIFICATIONS'] = $wrenchboard->wrenchboard_api($in, $out); + log_message('critical', "WrenchCrons ===> 0001"); //$response = []; //json_decode($complete, true); return $this->response->setJson($out);