Family list formater
This commit is contained in:
@@ -82,6 +82,26 @@ class ResultFormatter extends Model
|
|||||||
|
|
||||||
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
|
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
|
||||||
switch ($in["action"]) {
|
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:
|
case MOBILE_LOGIN:
|
||||||
$out["prefs"]=[];
|
$out["prefs"]=[];
|
||||||
$out["layout"]=[];
|
$out["layout"]=[];
|
||||||
|
|||||||
@@ -76,6 +76,26 @@ function processOutJson($in, $out) {
|
|||||||
|
|
||||||
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
|
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
|
||||||
switch ($in["action"]) {
|
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:
|
case MOBILE_LOGIN:
|
||||||
$out["prefs"]=[];
|
$out["prefs"]=[];
|
||||||
$out["layout"]=[];
|
$out["layout"]=[];
|
||||||
|
|||||||
Reference in New Issue
Block a user