client filter
This commit is contained in:
@@ -292,6 +292,8 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) {
|
|||||||
map<const char*, const char*>f1 = pgsql_fetch_assoc(res0, 0);
|
map<const char*, const char*>f1 = pgsql_fetch_assoc(res0, 0);
|
||||||
CVars res0;
|
CVars res0;
|
||||||
map_to_cvars(f1, res0);
|
map_to_cvars(f1, res0);
|
||||||
|
snprintf(extra_filter, sizeof (extra_filter), " AND mc.client_id = %lu ",res0["client_id"].Long());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,8 +305,8 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) {
|
|||||||
" WHEN mc.status = 1 AND mc.delivery_date <now() THEN 'Past Due' "
|
" WHEN mc.status = 1 AND mc.delivery_date <now() THEN 'Past Due' "
|
||||||
" ELSE 'Others' END) AS status_description,mc.delivery_date "
|
" ELSE 'Others' END) AS status_description,mc.delivery_date "
|
||||||
" FROM members_jobs_contract mc LEFT JOIN members_jobs mj ON mj.id = mc.job_id LEFT JOIN members m ON m.id=mc.client_id "
|
" FROM members_jobs_contract mc LEFT JOIN members_jobs mj ON mj.id = mc.job_id LEFT JOIN members m ON m.id=mc.client_id "
|
||||||
" WHERE mc.member_id =%lu AND mc.status IN (1,2,4) AND mc.delivery_date > now() "
|
" WHERE mc.member_id =%lu %s AND mc.status IN (1,2,4) AND mc.delivery_date > now() "
|
||||||
" ORDER BY mc.id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset);
|
" ORDER BY mc.id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(),extra_filter, limit, offset);
|
||||||
//ORDER BY id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset);
|
//ORDER BY id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset);
|
||||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
out["total_record"] = pgsql_num_rows(res);
|
out["total_record"] = pgsql_num_rows(res);
|
||||||
|
|||||||
Reference in New Issue
Block a user