family uid
This commit is contained in:
@@ -385,8 +385,11 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) {
|
||||
" WHEN mc.status = 1 AND mc.delivery_date < now() THEN 'PASTDUE' "
|
||||
" ELSE 'OTHERS' END) AS status_description,mc.delivery_date, "
|
||||
" (CASE WHEN mc.member_id = %lu THEN 'OWNER' ELSE 'WORKER' END) AS owner_status, m.firstname AS job_to, "
|
||||
" c.code AS currency_code, c.description AS currency_description,mj.country "
|
||||
" 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 "
|
||||
" c.code AS currency_code, c.description AS currency_description,mj.country, mf.uid AS family_uid "
|
||||
" 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 "
|
||||
" LEFT JOIN members_family mf ON mf.family_member_id = mc.client_id "
|
||||
" LEFT JOIN currency c ON c.country=mj.country "
|
||||
" WHERE mc.member_id =%lu %s %s %s "
|
||||
" ORDER BY mc.id DESC LIMIT %lu OFFSET %lu", member_id, member_id ,extra_filter, status_no_filter, status_filter, limit, offset);
|
||||
@@ -400,6 +403,9 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) {
|
||||
CVars rec;
|
||||
map_to_cvars(f, rec);
|
||||
|
||||
snprintf(vname, sizeof (vname), "family_uid_%05d", i);
|
||||
out[vname] = rec["family_uid"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "id_%05d", i);
|
||||
out[vname] = rec["contract_id"];
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ long RecoOffersInterest(int itm_count, CVars in, CVars &out ){
|
||||
int ic = itm_count;
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
res = pgsql_query(" SELECT mo.* FROm members_offer_interest mo LEFT JOIN members_jobs_offer mj ON mj.id= mo.offer_id"
|
||||
" WHERE mj.member_id = %lu AND mj.expire > now()",member_id);
|
||||
" WHERE mj.member_id = %lu AND mj.expire > now() AND mo.status = 1",member_id);
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
|
||||
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
||||
@@ -394,7 +394,7 @@ long RecoPendingInterestCount( int itm_count, CVars in, CVars &out ){
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
res = pgsql_query("SELECT moi.*,mjo.expire FROM members_offer_interest moi LEFT JOIN members_jobs_offer mjo ON mjo.id = moi.offer_id "
|
||||
" LEFT JOIN members_jobs j ON j.id= mjo.job_id "
|
||||
" WHERE moi.member_id = %lu AND mjo.expire > now() AND j.status= 1",member_id);
|
||||
" WHERE moi.member_id = %lu AND mjo.expire > now() AND j.status= 1 AND moi.status = 1",member_id);
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
|
||||
snprintf(vname, sizeof (vname), "title_%05d", ic);
|
||||
|
||||
Reference in New Issue
Block a user