result format

This commit is contained in:
CHIEFSOFT\ameye
2023-06-13 12:32:23 -04:00
parent e7876578da
commit 33136d62ba
2 changed files with 55 additions and 0 deletions
+28
View File
@@ -82,6 +82,34 @@ class ResultFormatter extends Model
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
switch ($in["action"]) {
case WRENCHBOARD_JOB_OFFER_INTLIST:
$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(
"client_id" => $out["client_id_${key}"],
"client_uid" => $out["client_uid_${key}"],
"client_name" => $out["client_name_${key}"],
"offer_code" => $out["offer_code_${key}"],
"offer_uid" => $out["offer_uid_${key}"],
"sent" => $out["sent_${key}"],
"title" => $out["title_${key}"],
"description" => $out["description_${key}"],
"job_id" => $out["job_id_${key}"],
"expire" => $out["expire_${key}"],
);
}
break;
case WRENCHBOARD_ACCOUNT_DASHDATA:
$res = $out;
$res['home_activities'] = [];
+27
View File
@@ -76,6 +76,33 @@ function processOutJson($in, $out) {
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
switch ($in["action"]) {
case WRENCHBOARD_JOB_OFFER_INTLIST:
$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(
"client_id" => $out["client_id_${key}"],
"client_uid" => $out["client_uid_${key}"],
"client_name" => $out["client_name_${key}"],
"offer_code" => $out["offer_code_${key}"],
"offer_uid" => $out["offer_uid_${key}"],
"sent" => $out["sent_${key}"],
"title" => $out["title_${key}"],
"description" => $out["description_${key}"],
"job_id" => $out["job_id_${key}"],
"expire" => $out["expire_${key}"],
);
}
break;
case WRENCHBOARD_ACCOUNT_DASHDATA:
$res = $out;
$res['home_activities'] = [];