From 06105f2940159a65c595b22aaa8e283db77b965a Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 20 Jun 2023 13:45:37 -0400 Subject: [PATCH] Result formater --- www-api/app/Models/ResultFormatter.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index 5eecdc3a..cad05b0f 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -119,7 +119,26 @@ class ResultFormatter extends Model } break; - + case WRENCHBOARD_USER_CARDLIST: + $total = $out["total_record"]; + $res = array( + "status" => $out["status"], + "total_record" => ($total - 1), + "internal_return" => $out["internal_return"], + "result_list" => array(), + ); + for ($i = 0; $i < $total; $i++) { + $key = sprintf("%05d", $i); + $res["result_list"][] = array( + "card_uid" => $out["card_uid_${key}"], + "description" => $out["description_${key}"], + "digits" => $out["digits_${key}"], + "added" => $out["added_${key}"], + "active" => $out["active_${key}"], + "type" => $out["type_${key}"], + ); + } + break; case WRENCHBOARD_ACCOUNT_DASHDATA: $res = $out; $res['home_activities'] = [];