wallet fix

This commit is contained in:
CHIEFSOFT\ameye
2023-09-24 18:56:17 -04:00
parent a4bbe30adb
commit d26872effe
2 changed files with 14 additions and 5 deletions
+12 -4
View File
@@ -2162,12 +2162,20 @@ long LoginWrenchBoardAccount(CVars in, CVars &out) {
in["loc"].set_valid(true);
load_db_record(in, "SELECT upper(md5(now()::text))||''|| upper(md5(now()::date::text)) AS sessionid");
ret = load_db_record(out, "SELECT *,id AS member_id , to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2 FROM members WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str());
ret = load_db_record(out, "SELECT *,id AS member_id , to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2,country FROM members WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str());
if (ret) {
if ( out["country"] !=""){
CVars vw;
vw["currency"] = "NAIRA"; // this might become a variable based on the country
vw["currency"].set_valid( true );
long wallet_id = CheckWallet(out["member_id"].Long(),vw);
load_db_record(vw, "SELECT code AS currency FROM currency WHERE country='%s'",out["country"].c_str());
if ( vw["currency"] !=""){
//vw["currency"] = "NAIRA"; // this might become a variable based on the country
vw["currency"].set_valid( true );
long wallet_id = CheckWallet(out["member_id"].Long(),vw);
}
}
load_db_record( out, "SELECT amount AS balance FROM members_wallet WHERE member_id = %lu AND currency='%s' ", out["member_id"].Long(), vw["currency"].c_str());
+2 -1
View File
@@ -119,7 +119,7 @@ class WrenchFaq extends BaseController
// );
// }
/*
for ($i = 0; $i < 5; $i++) {
$key = sprintf("%05d", $i);
@@ -129,6 +129,7 @@ class WrenchFaq extends BaseController
"msg" => "Random gibberish text to use in web pages, site templates and in typography demos. Get rid of Lorem Ipsum forever. A tool for web designers who want to save time. ".$key,
);
}
*/
return $data;
}