Interest count
This commit is contained in:
@@ -490,10 +490,43 @@ long WrenchReturnJobList(CVars in, CVars &out) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
wrenchboard=> SELECT count(mo.id),mj.offer_code FROM members_offer_interest mo
|
||||||
|
LEFT JOIN members_jobs_offer mj ON mj.id= mo.offer_id WHERE mj.expire > now() GROUP BY mj.offer_code
|
||||||
|
wrenchboard-> ;
|
||||||
|
count | offer_code
|
||||||
|
-------+------------
|
||||||
|
3 | 1B7R3134W0
|
||||||
|
3 | 66WW5B9B45
|
||||||
|
3 | Y1X0983WTP
|
||||||
|
(3 rows)
|
||||||
|
*/
|
||||||
|
|
||||||
|
const PGresult *res2;
|
||||||
|
|
||||||
|
res2 = pgsql_query("SELECT count(mo.id) AS interest_count,mj.offer_code FROM members_offer_interest mo "
|
||||||
|
" LEFT JOIN members_jobs_offer mj ON mj.id= mo.offer_id "
|
||||||
|
" WHERE mj.expire > now() GROUP BY mj.offer_code");
|
||||||
|
|
||||||
|
if (res2 != NULL && pgsql_num_rows(res2) > 0) {
|
||||||
|
out["total_interest_record"] = pgsql_num_rows(res2);
|
||||||
|
|
||||||
|
for (int ii = 0, n = pgsql_num_rows(res2); ii < n; ii++) {
|
||||||
|
map<const char*, const char*>f2 = pgsql_fetch_assoc(res2, ii);
|
||||||
|
if (f2.empty()) continue;
|
||||||
|
CVars rec2;
|
||||||
|
map_to_cvars(f2, rec2);
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "interest_count_%s", rec2["offer_code"].c_str());
|
||||||
|
out[vname] = rec2["interest_count"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ret = PHP_API_OK;
|
ret = PHP_API_OK;
|
||||||
out["status"] = "OK";
|
out["status"] = "OK";
|
||||||
} catch (bad_parameter) {
|
} catch (bad_parameter) {
|
||||||
logfmt(logINFO, "ERROR CALL long medTrReasonList(CVars in, CVars &out)");
|
logfmt(logINFO, "ERROR CALL long WrenchReturnJobList(CVars in, CVars &out)");
|
||||||
}
|
}
|
||||||
logfmt(logINFO, "/WrenchReturnJobList()");
|
logfmt(logINFO, "/WrenchReturnJobList()");
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ long RecoOffersInterest(int itm_count, CVars in, CVars &out ){
|
|||||||
out[vname] = "Continue";
|
out[vname] = "Continue";
|
||||||
|
|
||||||
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
|
snprintf(vname, sizeof (vname), "short_button_text_%05d", ic);
|
||||||
out[vname] = "short_button_text";
|
out[vname] = "View now";
|
||||||
|
|
||||||
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
snprintf(vname, sizeof (vname), "short_title_%05d", ic);
|
||||||
out[vname] = "Interest Pending";
|
out[vname] = "Interest Pending";
|
||||||
@@ -259,7 +259,7 @@ long RecoCheckFamilyLogin(int itm_count, CVars in, CVars &out ){
|
|||||||
try {
|
try {
|
||||||
int ic = itm_count;
|
int ic = itm_count;
|
||||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||||
res = pgsql_query("SELECT count(id) AS family_count FROM members_family WHERE member_id = %lu AND status = 1 AND last_login IS NULL ",member_id);
|
res = pgsql_query("SELECT id FROM members_family WHERE member_id = %lu AND status = 1 AND last_login IS NULL ",member_id);
|
||||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
|
|
||||||
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
||||||
|
|||||||
Reference in New Issue
Block a user