Family waiting
This commit is contained in:
@@ -90,8 +90,13 @@ long WrenchSuggestWaitingList(CVars in, CVars &out){ // this is the parent now
|
|||||||
// res = pgsql_query("SELECT id FROM family_task_suggestion WHERE status=1 ");
|
// res = pgsql_query("SELECT id FROM family_task_suggestion WHERE status=1 ");
|
||||||
// out["total_record"] = pgsql_num_rows(res);
|
// out["total_record"] = pgsql_num_rows(res);
|
||||||
|
|
||||||
res = pgsql_query(" SELECT * FROM members_family_suggesttask WHERE family_uid::text IN (SELECT uid::text FROM members_family WHERE member_id = %lu) AND status IN ( 1,2,3,4,5) "
|
res = pgsql_query("SELECT sg.*,mf.firstname,to_char(sg.created, 'Day Mon dd, yyyy HH:MI AM') AS formarted_added "
|
||||||
" ORDER BY created DESC LIMIT %lu OFFSET %lu", member_id, limit, offset);
|
" FROM members_family_suggesttask sg "
|
||||||
|
" LEFT JOIN members_family mf ON mf.uid::text = sg.family_uid "
|
||||||
|
" WHERE sg.family_uid::text IN (SELECT uid::text FROM members_family "
|
||||||
|
" WHERE member_id = %lu ) "
|
||||||
|
" AND sg.status IN ( 1,2,3,4,5) "
|
||||||
|
" ORDER BY sg.created DESC LIMIT %lu OFFSET %lu", member_id, 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);
|
||||||
@@ -115,13 +120,17 @@ long WrenchSuggestWaitingList(CVars in, CVars &out){ // this is the parent now
|
|||||||
out[vname] = rec["description"];
|
out[vname] = rec["description"];
|
||||||
|
|
||||||
snprintf(vname, sizeof (vname), "added_%05d", i);
|
snprintf(vname, sizeof (vname), "added_%05d", i);
|
||||||
out[vname] = rec["created"];
|
out[vname] = rec["formarted_added"];
|
||||||
|
|
||||||
snprintf(vname, sizeof (vname), "status_%05d", i);
|
snprintf(vname, sizeof (vname), "status_%05d", i);
|
||||||
out[vname] = rec["status"];
|
out[vname] = rec["status"];
|
||||||
|
|
||||||
snprintf(vname, sizeof (vname), "banner_%05d", i);
|
snprintf(vname, sizeof (vname), "banner_%05d", i);
|
||||||
out[vname] = rec["banner"];
|
out[vname] = rec["banner"];
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "firstname_%05d", i);
|
||||||
|
out[vname] = rec["firstname"];
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = PHP_API_OK;
|
ret = PHP_API_OK;
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ class ResultFormatter extends Model
|
|||||||
"status" => $out["status_${key}"],
|
"status" => $out["status_${key}"],
|
||||||
"status_text" => $statusTxt ,
|
"status_text" => $statusTxt ,
|
||||||
"banner" => $out["banner_${key}"],
|
"banner" => $out["banner_${key}"],
|
||||||
|
"firstname" => $out["firstname_${key}"],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user