family member_id
This commit is contained in:
@@ -57,6 +57,7 @@ long WrenchBoardTopupResult(CVars in, CVars &out);
|
|||||||
long WrenchRegisterMyFileUpload(CVars in, CVars &out);
|
long WrenchRegisterMyFileUpload(CVars in, CVars &out);
|
||||||
long WrenchGetRecentDash(CVars in, CVars &out);
|
long WrenchGetRecentDash(CVars in, CVars &out);
|
||||||
long LoginWrenchBoardQRAccount(CVars in, CVars &out);
|
long LoginWrenchBoardQRAccount(CVars in, CVars &out);
|
||||||
|
long WrenchBoardFamilyAccMemberID(CVars in, CVars &out);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1998,6 +1998,42 @@ long LoginLogger( long member_id, long login_mode){
|
|||||||
long LoginWrenchBoardFamilyLogin(CVars in, CVars &out);
|
long LoginWrenchBoardFamilyLogin(CVars in, CVars &out);
|
||||||
long WrenchBoardCreateFamilyAcc(CVars in, CVars &out);
|
long WrenchBoardCreateFamilyAcc(CVars in, CVars &out);
|
||||||
|
|
||||||
|
long WrenchBoardFamilyAccMemberID(CVars in, CVars &out){
|
||||||
|
long ret = PHP_API_BAD_PARAM;
|
||||||
|
long family_member_id = 0;
|
||||||
|
long parent_member_id = 0;
|
||||||
|
long wallet_id = 0;
|
||||||
|
logfmt(logINFO, "********~~~~~~~~ ------WrenchBoardFamilyAccMemberID()");
|
||||||
|
try {
|
||||||
|
|
||||||
|
REQ_STRING(in, "username", 5, 49, "(.*)");
|
||||||
|
REQ_STRING(in, "pin", 4, 10, "(.*)");
|
||||||
|
const PGresult *res = pgsql_query(" SELECT member_id AS parent_member_id, id AS family_id,* FROM members_family "
|
||||||
|
" WHERE uid='%s'", in["family_uid"].c_str());
|
||||||
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
|
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
|
||||||
|
CVars rec;
|
||||||
|
map_to_cvars(f, rec);
|
||||||
|
if( rec["family_member_id"]==""){
|
||||||
|
logfmt(logINFO, "LoginWrenchBoardFamilyLogin()- Need to Construct Account Now------->");
|
||||||
|
family_member_id = WrenchBoardCreateFamilyAcc(rec,out);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
family_member_id =rec["family_member_id"].Long();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
family_member_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (bad_parameter) {
|
||||||
|
logfmt(logINFO, "ERROR CALL long WrenchBoardCreateFamilyAcc(CVars in, CVars &out)");
|
||||||
|
}
|
||||||
|
|
||||||
|
return family_member_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
long WrenchBoardCreateFamilyAcc(CVars in, CVars &out){
|
long WrenchBoardCreateFamilyAcc(CVars in, CVars &out){
|
||||||
long ret = 0;
|
long ret = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -986,6 +986,10 @@ wrenchboard=> select * from members_family;
|
|||||||
logfmt(logINFO, "WrenchFamilyManage()- NEED TI INITIALIZE USERNAME PIN");
|
logfmt(logINFO, "WrenchFamilyManage()- NEED TI INITIALIZE USERNAME PIN");
|
||||||
WrenchFamilyInitializeAccount(rec,out);
|
WrenchFamilyInitializeAccount(rec,out);
|
||||||
}
|
}
|
||||||
|
if( rec["family_member_id"]==""){
|
||||||
|
WrenchBoardFamilyAccMemberID(in, out);
|
||||||
|
}
|
||||||
|
|
||||||
out = rec;
|
out = rec;
|
||||||
ret = PHP_API_OK;
|
ret = PHP_API_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user