From 574c98a5da8c8274b930b90fe85ee1ff6275c436 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 19 Jul 2023 20:00:44 -0400 Subject: [PATCH] fix format --- www-api/app/Controllers/WrenchDashRecent.php | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/www-api/app/Controllers/WrenchDashRecent.php b/www-api/app/Controllers/WrenchDashRecent.php index b2e93a4d..2f6a6c4f 100644 --- a/www-api/app/Controllers/WrenchDashRecent.php +++ b/www-api/app/Controllers/WrenchDashRecent.php @@ -109,6 +109,39 @@ class WrenchDashRecent extends BaseController // return $this->response->setJson($response); } + public function processRecentOutJson($in, $out) { + + $action = $in["action"]; + switch($action){ + case WRENCHBOARD_FAMILY_SGGESTLIST: + case WRENCHBOARD_FAMILY_SGGESTWAITING: + $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); + $status_no = $out["status_${key}"]; + $statusTxt = $this->suggestedStatusText($status_no); + $res["result_list"][] = array( + "uid" => $out["uid_${key}"], + "family_uid" => $out["family_uid_${key}"], + "description" => $out["description_${key}"], + "title" => $out["title_${key}"], + "added" => $out["added_${key}"], + "status" => $out["status_${key}"], + "status_text" => $statusTxt , + "banner" => $out["banner_${key}"], + ); + } + break; + + } + return $res; + } private function dashRecent($in,$out){ // $ret = 0; $in["action"] = WRENCHBOARD_FAMILY_SGGESTWAITING;