Purchase hixtory
This commit is contained in:
@@ -31,11 +31,11 @@ long WrenchPurchaseHx( CVars in, CVars &out )
|
||||
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
res = pgsql_query("SELECT added::date AS added_date," \
|
||||
" (CASE WHEN code ='MNCCD' THEN 'New Card Payment' " \
|
||||
"WHEN code ='MRCCD' THEN 'Repeat Card Payment' " \
|
||||
"ELSE '' END) AS description,amount*0.01 AS amount,fee*0.01 as fee,confirmation " \
|
||||
"FROM members_payments " \
|
||||
res = pgsql_query("SELECT id, uid,added::date AS added_date,"
|
||||
" (CASE WHEN code ='MNCCD' THEN 'New Card Payment' "
|
||||
"WHEN code ='MRCCD' THEN 'Repeat Card Payment' "
|
||||
"ELSE '' END) AS description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
|
||||
"FROM members_payments "
|
||||
"WHERE member_id = %lu AND status = 1 ORDER BY id DESC LIMIT %lu",member_id,limit);
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
@@ -63,8 +63,11 @@ long WrenchPurchaseHx( CVars in, CVars &out )
|
||||
snprintf(vname, sizeof (vname), "confirmation_%05d", i);
|
||||
out[vname] = rec["confirmation"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "card_icon_%05d", i);
|
||||
out[vname] = rec["card_icon"];
|
||||
snprintf(vname, sizeof (vname), "id_%05d", i);
|
||||
out[vname] = rec["id"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "uid_%05d", i);
|
||||
out[vname] = rec["uid"];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "pgsql_wrapper.h"
|
||||
#include <curl/curl.h>
|
||||
#include "account.h"
|
||||
#include "history.h"
|
||||
|
||||
#include "account_mngt.h"
|
||||
#include "contract.h"
|
||||
@@ -44,7 +45,9 @@ long mobile_calls(CVars in, CVars &out) {
|
||||
case WRENCHBOARD_MOBILE_PAYMENTHX:
|
||||
return WrenchReturnMemberPaymentHx( in, out);
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_MOBILE_PURCHASEHX:
|
||||
return WrenchPurchaseHx( in, out);
|
||||
break;
|
||||
case WRENCHBOARD_MOBILE_TASKMESSAGE:
|
||||
return WrenchReturnTaskMessage( in, out);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user