This commit is contained in:
2022-08-06 16:07:10 -04:00
parent 0074b8a998
commit 7f32e70b9b
4 changed files with 28 additions and 14 deletions
@@ -133,6 +133,8 @@ enum { PARTNER_STRIPE };
#define WRENCHBOARD_BKO_CREATEUSER 10015
#define WRENCHBOARD_BKO_UPDATEUSER 10020
#define WRENCHBOARD_BKO_RESEND_OFFER 10025
#define WRENCHBOARD_BKO_END 10999
//**************************************************************
#define WRENCHBOARD_ACCOUNT_START 11000
+12 -3
View File
@@ -15,6 +15,7 @@
#include "account.h"
long BkoCommonSessionCheck(long backoffice_id,long shop,long acc, const char *sessionid, int create );
long BkoResendOffer(CVars in, CVars &out);
long bko_calls(CVars in, CVars &out)
{
@@ -25,15 +26,23 @@ long bko_calls(CVars in, CVars &out)
{
case WRENCHBOARD_BKO_LOGIN:
return LoginBkoAdmin( in, out);
break;
break;
case WRENCHBOARD_BKO_RESEND_OFFER:
return BkoResendOffer( in, out);
break;
}
logfmt( logINFO, "/bko_calls()" );
return 0;
}
long BkoResendOffer(CVars in, CVars &out)
{
logfmt( logINFO, "BkoResendOffer()" );
REQ_STRING (in, "offer_code", 5, 49, "(.*)");
logfmt( logINFO, "/BkoResendOffer()" );
}
long LoginBkoAdmin(CVars in, CVars &out)
+2 -1
View File
@@ -571,7 +571,8 @@ long WrenchSendJobsOfferIndividual(CVars in, CVars &out) {
srand((unsigned) time(NULL));
int r = rand();
in["offer_code"] = 10000000 * r*r;
in["offer_code"].set_valid(true);
long offer_id = 0;
out = in;
/*
+12 -10
View File
@@ -479,15 +479,15 @@ Foreign-key constraints:
vw["currency"].set_valid( true );
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
long retDb = load_db_record( out, "SELECT amount AS curr_balance FROM members_wallet WHERE member_id = %lu AND id = %lu", in["member_id"].Long(),wallet_id);
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Invalid user";
return PHP_API_BAD_PARAM; }
return PHP_API_BAD_PARAM;
}
long retDb2 = load_db_record( out, "SELECT jj.price,0 as fee FROM members_jobs_offer j LEFT JOIN members_jobs jj ON jj.id=j.job_id WHERE j.id =%lu ",in["offer_id"].Long());
if (retDb2)
@@ -566,14 +566,15 @@ long WrenchRefundoffer( CVars in, CVars &out )
vw["currency"].set_valid( true );
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
long retDb = load_db_record( out, "SELECT amount AS curr_balance FROM members_wallet WHERE member_id = %lu AND id = %lu", in["member_id"].Long(),wallet_id);
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Invalid user";
return PHP_API_BAD_PARAM; }
return PHP_API_BAD_PARAM;
}
long retDb2 = load_db_record( out, "SELECT * FROM members_payments WHERE id =%lu AND what_offer = %lu AND member_id=%lu AND code = 'OFDPS' AND status = 1 AND flags = 4 AND confirmation IS NOT NULL",payment_id,offer_id,member_id);
@@ -667,7 +668,11 @@ long WrenchContractPayment( CVars in, CVars &out )
return PHP_API_BAD_PARAM;
}
CVars vw;
vw["currency"] = "NAIRA"; // this might become a variable based on the country
vw["currency"].set_valid( true );
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
// TEST FOR DUPLICATE
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", client_id);
@@ -679,10 +684,7 @@ long WrenchContractPayment( CVars in, CVars &out )
return PHP_API_BAD_PARAM; }
CVars vw;
vw["currency"] = "NAIRA"; // this might become a variable based on the country
vw["currency"].set_valid( true );
long wallet_id = CheckWallet(in["member_id"].Long(),vw);
/*