From fad81fa012905fe73de552c01fbac28f015971e9 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 2 Jul 2023 16:56:09 -0400 Subject: [PATCH] family task formrter --- www-api/app/Models/ResultFormatter.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index ccfe39e9..4b967c8b 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -82,7 +82,27 @@ class ResultFormatter extends Model // id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status switch ($in["action"]) { - + case WRENCHBOARD_FAMILY_SAMPLETASKS: + $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( + "uid" => $out["uid_${key}"], + "description" => $out["description_${key}"], + "title" => $out["title_${key}"], + "added" => $out["added_${key}"], + "age" => $out["age_${key}"], + "banner" => $out["banner_${key}"], + ); + } + break; + case WRENCHBOARD_JOB_OFFER_INTLIST: case WRENCHBOARD_JOB_WAITING_INT: