job controls
This commit is contained in:
@@ -423,6 +423,7 @@ long WrenchReturnMemberMessages(CVars in, CVars &out) {
|
||||
/* This return the list of jobs on the home page of the apps*/
|
||||
long WrenchReturnJobList(CVars in, CVars &out) {
|
||||
logfmt(logINFO, "WrenchReturnJobList()");
|
||||
char extraQ[300];
|
||||
char vname[30];
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
|
||||
@@ -433,8 +434,12 @@ long WrenchReturnJobList(CVars in, CVars &out) {
|
||||
|
||||
if ( in["member_id"].Long() > 0 && in["uid"] !=""){
|
||||
logfmt(logINFO, "*** WrenchReturnJobList() member_id = %lu uid=%s", in["member_id"].Long(), in["uid"].c_str());
|
||||
snprintf(extraQ, sizeof (extraQ), " AND j.country IN (SELECT c.country FROM members_wallet w LEFT JOIN currency c ON c.code =w.currency WHERE w.member_id = %lu ) ", in["member_id"].Long());
|
||||
}
|
||||
|
||||
else{
|
||||
snprintf(extraQ, sizeof (extraQ), " ");
|
||||
}
|
||||
|
||||
|
||||
REQ_LONG(in, "page", 1, -1);
|
||||
out["total_record"] = "0";
|
||||
@@ -449,8 +454,8 @@ long WrenchReturnJobList(CVars in, CVars &out) {
|
||||
" LEFT JOIN currency c ON c.country=j.country "
|
||||
" WHERE m.status = 1 AND m.client_id=0 "
|
||||
" AND m.expire IS NOT NULL "
|
||||
" AND m.public_view = 1 AND m.expire> now() AND j.status = 1 "
|
||||
" ORDER BY m.expire DESC LIMIT %lu", in["limit"].Long());
|
||||
" AND m.public_view = 1 AND m.expire> now() AND j.status = 1 %s "
|
||||
" ORDER BY m.expire DESC LIMIT %lu", extraQ, in["limit"].Long());
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
out["total_record"] = pgsql_num_rows(res);
|
||||
|
||||
Reference in New Issue
Block a user