diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index 5a9e1cda..d2042df4 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -82,6 +82,26 @@ class ResultFormatter extends Model // id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status switch ($in["action"]) { + case WRENCHBOARD_FAMILY_LIST: + + $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}"], + "firstname" => $out["firstname_${key}"], + "lastname" => $out["lastname_${key}"], + "age" => $out["age_${key}"] + ); + } + + break; case MOBILE_LOGIN: $out["prefs"]=[]; $out["layout"]=[]; diff --git a/www-api/public/svs/user/formarter.php b/www-api/public/svs/user/formarter.php index 7951ed71..3b670d3c 100755 --- a/www-api/public/svs/user/formarter.php +++ b/www-api/public/svs/user/formarter.php @@ -76,6 +76,26 @@ function processOutJson($in, $out) { // id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status switch ($in["action"]) { + case WRENCHBOARD_FAMILY_LIST: + + $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}"], + "firstname" => $out["firstname_${key}"], + "lastname" => $out["lastname_${key}"], + "age" => $out["age_${key}"] + ); + } + + break; case MOBILE_LOGIN: $out["prefs"]=[]; $out["layout"]=[];