diff --git a/wrenchboard/src/shared_tool/coupons.cc b/wrenchboard/src/shared_tool/coupons.cc index 5aa747a3..ad09e0ee 100644 --- a/wrenchboard/src/shared_tool/coupons.cc +++ b/wrenchboard/src/shared_tool/coupons.cc @@ -193,7 +193,9 @@ long MemberCouponList( CVars in, CVars &out ){ out["total_record"] = "0"; const PGresult *res; - res = pgsql_query("SELECT id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status FROM coupons_allocation ca WHERE ca.member_id = %lu AND %s ORDER BY ca.id DESC", in["member_id"].Long(),in["active_q"].c_str()); + res = pgsql_query(" SELECT id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status " + " FROM coupons_allocation ca WHERE ca.member_id = %lu " + " AND %s ORDER BY ca.id DESC", in["member_id"].Long(),in["active_q"].c_str()); if (res != NULL && pgsql_num_rows(res) > 0) { out["total_record"] = pgsql_num_rows(res); diff --git a/wrenchboard/src/shared_tool/jobs_manager.cc b/wrenchboard/src/shared_tool/jobs_manager.cc index cc4008d3..1ca51ff5 100644 --- a/wrenchboard/src/shared_tool/jobs_manager.cc +++ b/wrenchboard/src/shared_tool/jobs_manager.cc @@ -325,7 +325,7 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) { 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, " - " mj.title, mj.description AS description,mc.job_detail AS job_description, " + " mj.title, mj.description AS description,mc.job_detail AS job_description, mc.uid AS contract_uid, " " (CASE WHEN mc.status=4 THEN 'REVIEW' " " WHEN mc.status = 1 AND mc.delivery_date > now() THEN 'ACTIVE' " " WHEN mc.status = 1 AND mc.delivery_date < now() THEN 'PASTDUE' " @@ -392,6 +392,9 @@ long WrenchJobManagerActiveTasksList(CVars in, CVars &out) { snprintf(vname, sizeof (vname), "owner_status_%05d", i); out[vname] = rec["owner_status"]; + snprintf(vname, sizeof (vname), "contract_uid_%05d", i); + out[vname] = rec["contract_uid"]; + } } ret = PHP_API_OK; @@ -422,7 +425,7 @@ long WrenchUsersActiveTasksList(CVars in, CVars &out) { res = pgsql_query("SELECT mc.id AS contract_id, mc.job_id AS job_id, mc.price, mc.timeline_days,mc.contract, " - " mj.title, mj.description AS description,mc.job_detail AS job_description, " + " mj.title, mj.description AS description,mc.job_detail AS job_description,mc.uid AS contract_uid, " " (CASE WHEN mc.status=4 THEN 'REVIEW' " " WHEN mc.status = 1 AND mc.delivery_date > now() THEN 'ACTIVE' " " WHEN mc.status = 1 AND mc.delivery_date $out["price_${key}"], "timeline_days" => $out["timeline_days_${key}"], "contract_id" => $out["contract_id_${key}"], + "contract_uid" => $out["contract_uid_${key}"], "job_id" => $out["job_id_${key}"], "contract" => $out["contract_${key}"], "status_description" => $out["status_description_${key}"], diff --git a/www-api/public/svs/user/formarter.php b/www-api/public/svs/user/formarter.php index 834a6e15..d4c555f7 100755 --- a/www-api/public/svs/user/formarter.php +++ b/www-api/public/svs/user/formarter.php @@ -344,6 +344,7 @@ function processOutJson($in, $out) { "price" => $out["price_${key}"], "timeline_days" => $out["timeline_days_${key}"], "contract_id" => $out["contract_id_${key}"], + "contract_uid" => $out["contract_uid_${key}"], "job_id" => $out["job_id_${key}"], "contract" => $out["contract_${key}"], "status_description" => $out["status_description_${key}"],