From be0655f5e125bc4bb05f87a8eaf03a4b940d9db4 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 8 Jun 2023 12:52:15 -0400 Subject: [PATCH] Review job codes --- wrenchboard/src/shared_tool/jobs_manager.cc | 9 +++- wrenchboard/src/shared_tool/reco_egine.cc | 55 +++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/wrenchboard/src/shared_tool/jobs_manager.cc b/wrenchboard/src/shared_tool/jobs_manager.cc index ea9bd916..479ed561 100644 --- a/wrenchboard/src/shared_tool/jobs_manager.cc +++ b/wrenchboard/src/shared_tool/jobs_manager.cc @@ -271,6 +271,7 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) { logfmt(logINFO, "WrenchJobManagerActiveTasksList()"); char vname[30]; char status_filter[300]; + char status_no_filter[300]; char extra_filter[300]; long ret = PHP_API_BAD_PARAM; @@ -314,6 +315,10 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) { snprintf(status_filter, sizeof (status_filter), " AND mc.delivery_date < now() "); } + snprintf(status_no_filter, sizeof (status_no_filter), " AND mc.status IN (1,2,4) "); + + + const PGresult *res; res = pgsql_query("SELECT mc.id AS contract_id, mc.job_id AS job_id, mc.price, mc.timeline_days,mc.contract, " @@ -324,8 +329,8 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) { " ELSE 'OTHERS' END) AS status_description,mc.delivery_date, " " (CASE WHEN mc.member_id = %lu THEN 'OWNER' ELSE 'WORKER' END) AS owner_status " " 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 %s AND mc.status IN (1,2,4) %s " - " ORDER BY mc.id DESC LIMIT %lu OFFSET %lu", member_id, member_id ,extra_filter, status_filter, limit, offset); + " 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); //ORDER BY id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset); if (res != NULL && pgsql_num_rows(res) > 0) { out["total_record"] = pgsql_num_rows(res); diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 97bc15ec..e48bdaa5 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -31,6 +31,7 @@ long RecoCheckFamilyLogin( int itm_count, CVars in, CVars &out ); long RecoCheckFamilyCount( int itm_count, CVars in, CVars &out ); long RecoCheckCoupons( int itm_count, CVars in, CVars &out ); long RecoCheckTaskDue( int itm_count, CVars in, CVars &out ); +long RecoCheckTaskReview( int itm_count, CVars in, CVars &out ); long RecoCheckBlog( int itm_count, CVars in, CVars &out ); @@ -76,6 +77,7 @@ long WrenchHomeBanners(CVars in, CVars &out) { if( RecoCheckFamilyLogin( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckFamilyCount( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckCoupons( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } + if( RecoCheckTaskReview( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckTaskDue( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckBlog( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } @@ -372,6 +374,59 @@ long RecoCheckTaskDue( int itm_count, CVars in, CVars &out ){ return ret; } + +long RecoCheckTaskReview( int itm_count, CVars in, CVars &out ){ + logfmt(logINFO, "RecoCheckTaskReview()"); + long ret = PHP_API_BAD_PARAM; + const PGresult *res; + char vname[30]; + try { + int ic = itm_count; + long member_id = REQ_LONG(in, "member_id", 1, -1); + res = pgsql_query("SELECT * FROM members_jobs_contract WHERE member_id = %lu AND status = 4 ",member_id); + if (res != NULL && pgsql_num_rows(res) > 0) { + + snprintf(vname, sizeof (vname), "title_%05d", ic); + out[vname] = "Some of your task as owner Need Review now "; + + snprintf(vname, sizeof (vname), "description_%05d", ic); + out[vname] = "Some of your task as owner Need Review now,Some of your task as owner Need Review now, S Need Review now"; + + snprintf(vname, sizeof (vname), "card_type_%05d", ic); + out[vname] = "REVIEWJOB"; + + snprintf(vname, sizeof (vname), "offer_id_%05d", ic); + out[vname] = "0"; + + snprintf(vname, sizeof (vname), "blog_id_%05d", ic); + out[vname] = "0"; + + snprintf(vname, sizeof (vname), "card_icon_%05d", ic); + out[vname] = "icon1"; + + snprintf(vname, sizeof (vname), "banner_%05d", ic); + out[vname] ="banner-job-due.jpg"; + + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="LOCAL"; + + snprintf(vname, sizeof (vname), "link_path_%05d", ic); + out[vname] = "my-review-jobs"; + + snprintf(vname, sizeof (vname), "button_text_%05d", ic); + out[vname] = "View Tasks"; + + ret = PHP_API_OK; + } + } catch (bad_parameter) { + out["status"] = "ERROR"; + } + logfmt(logINFO, "/RecoCheckTaskReview()"); +return ret; + +} + + long RecoCheckBlog( int itm_count, CVars in, CVars &out ){ logfmt(logINFO, "RecoCheckBlog()"); long ret = PHP_API_BAD_PARAM;