fix
This commit is contained in:
@@ -185,6 +185,8 @@ define('WRENCHBOARD_COMPLETE_PASSWORDRESET', 730);
|
||||
//#define WRENCHBOARD_START_ADDMONEY', 770 );
|
||||
//#define WRENCHBOARD_COMPLETE_ADDMONEY' 775 );
|
||||
|
||||
define('WRENCHBOARD_CARDS_GETCARDLIST', 40010);
|
||||
define('WRENCHBOARD_CARDS_UPDATECARD', 40015) ;
|
||||
|
||||
define('WRENCHBOARD_COUPON_REDEEM', 85020);
|
||||
define('WRENCHBOARD_COUPON_MEMLIST', 85025);
|
||||
|
||||
@@ -33,6 +33,25 @@ function formatCreateTranspData($in) {
|
||||
return $in;
|
||||
}
|
||||
|
||||
snprintf(vname, sizeof (vname), "assign_id_%05d", i);
|
||||
out[vname] = rec["id"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "title_%05d", i);
|
||||
out[vname] = rec["title"];
|
||||
|
||||
// amount | id | code | description | symbol | action_type | lorder | current_balance
|
||||
snprintf(vname, sizeof (vname), "description_%05d", i);
|
||||
out[vname] = rec["description"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "card_type_%05d", i);
|
||||
out[vname] = rec["card_type"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "card_style_%05d", i);
|
||||
out[vname] = rec["card_style"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "card_icon_%05d", i);
|
||||
out[vname] = rec["card_icon"];
|
||||
|
||||
function processOutJson($in, $out) {
|
||||
if ($in["action"] != MEDTRANS_USER_GET_TRANSLIST) {
|
||||
// return $out;
|
||||
@@ -40,7 +59,28 @@ function processOutJson($in, $out) {
|
||||
|
||||
// id AS coupon_id, ca.code, ca.amount, ca.added::date,ca.status
|
||||
switch ($in["action"]) {
|
||||
|
||||
case WRENCHBOARD_CARDS_GETCARDLIST:
|
||||
|
||||
$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(
|
||||
"assign_id" => $out["assign_id_${key}"],
|
||||
"title" => $out["title_${key}"],
|
||||
"description" => $out["description_${key}"],
|
||||
"card_type" => $out["card_type_${key}"],
|
||||
"card_style" => $out["card_style_${key}"],
|
||||
"card_icon" => $out["card_icon_${key}"] );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_COUPON_MEMLIST:
|
||||
case WRENCHBOARD_COUPON_PENDLIST:
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ switch ($endpoint) {
|
||||
$call_backend = false;
|
||||
break;
|
||||
case 'userscards':
|
||||
$in["action"] = WRENCHBOARD_CARDS_GETCARDLIST;
|
||||
$local_out = [
|
||||
'result'=>'100',
|
||||
'result_list'=>[
|
||||
|
||||
Reference in New Issue
Block a user