Result formating

This commit is contained in:
CHIEFSOFT\ameye
2023-05-18 11:53:21 -04:00
parent c82f368e47
commit 7d361efb3d
2 changed files with 42 additions and 0 deletions
+20
View File
@@ -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_CONTRACT_MSGLIST:
$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(
"message" => $out["message_${key}"],
"msg" => $out["msg_${key}"],
"msg_date" => $out["msg_date_${key}"],
"msg_firstname" => $out["msg_firstname_${key}"],
"msg_id" => $out["msg_id_${key}"],
"msg_type" => $out["msg_type_${key}"],
);
}
break;
case WRENCHBOARD_FAMILY_LIST:
$total = $out["total_record"];
+22
View File
@@ -76,6 +76,28 @@ function processOutJson($in, $out) {
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
switch ($in["action"]) {
case WRENCHBOARD_CONTRACT_MSGLIST:
$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(
"message" => $out["message_${key}"],
"msg" => $out["msg_${key}"],
"msg_date" => $out["msg_date_${key}"],
"msg_firstname" => $out["msg_firstname_${key}"],
"msg_id" => $out["msg_id_${key}"],
"msg_type" => $out["msg_type_${key}"],
);
}
break;
case WRENCHBOARD_FAMILY_LIST:
$total = $out["total_record"];