From 6cca83bb4d49e353208421d384808ac6aca3ff7e Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 21 Oct 2023 15:01:30 -0400 Subject: [PATCH] added uid --- wrenchboard/src/shared_tool/coupons.cc | 6 +++++- www-api/app/Models/ResultFormatter.php | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wrenchboard/src/shared_tool/coupons.cc b/wrenchboard/src/shared_tool/coupons.cc index 61a16c56..b7529921 100644 --- a/wrenchboard/src/shared_tool/coupons.cc +++ b/wrenchboard/src/shared_tool/coupons.cc @@ -203,7 +203,7 @@ 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,ca.active " + res = pgsql_query(" SELECT id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status,ca.active,ca.uid AS allocation_uid " " 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()); @@ -234,6 +234,10 @@ long MemberCouponList( CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "active_%05d", i); out[vname] = rec["active"]; + snprintf(vname, sizeof (vname), "allocation_uid_%05d", i); + out[vname] = rec["allocation_uid"]; + + } } ret = PHP_API_OK; diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index 470b2beb..4b2ab4b5 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -455,6 +455,7 @@ class ResultFormatter extends Model "added" => $out["added_${key}"], "status" => $out["status_${key}"], "active" => $out["active_${key}"], + "allocation_uid"=> $out["allocation_uid_${key}"], 'currency' => 'Naira', 'currency_code' => 'NGN' );