duplicate test

This commit is contained in:
CHIEFSOFT\ameye
2024-01-23 12:37:51 -05:00
parent 3e87594dc9
commit f04fec6c34
2 changed files with 31 additions and 8 deletions
+11 -8
View File
@@ -185,14 +185,17 @@ long WrenchFamilyInvite(CVars in, CVars &out){
out["invite_id"] ="0";// we will set if all okay
// const PGresult *res = pgsql_query("SELECT id FROM members_family_relative "
// " WHERE LOWER('%s') = LOWER(email) AND member_id= %lu", in["email"].c_str(), member_id);
if ( load_db_record(out, "SELECT count(id) AS prev_entry FROM members_family_relative "
" WHERE LOWER('%s') = LOWER(email) AND member_id= %lu", in["email"].c_str(), member_id)== 0){
load_db_record(out, "SELECT count(id) AS prev_entry FROM members_family_relative "
" WHERE LOWER('%s') = LOWER(email) AND member_id= %lu", in["email"].c_str(), member_id);
if ( out["prev_entry"].Long()> 0){
out["status_msg"] = "Duplicate";
out["status_msg"] = "DUPLICATE";
}
else{
if ( out["prev_entry"].Long() == 0)
{
//
// if ( out["prev_entry"].Long()> 0){
// out["status_msg"] = "Duplicate";
// out["status_msg"] = "DUPLICATE";
// }
// else{
CVars xx;
xx["member_id"] = member_id;
xx["member_id"].set_valid(true);
@@ -215,7 +218,7 @@ long WrenchFamilyInvite(CVars in, CVars &out){
ret = PHP_API_OK;
out["status"] = "OK";
}
// }
}
+20
View File
@@ -237,6 +237,26 @@ class ResultFormatter extends Model
);
}
break;
case WRENCHBOARD_FAMILY_RELINVITE:
$total = $out["total_record"];
$res = array(
"status" => $out["status"],
"total_record" => ($total),
"internal_return" => $out["internal_return"],
"result_list" => array(),
);
for ($i = 0; $i < $total; $i++) {
$key = sprintf("%05d", $i);
$res["result_list"][] = array(
"uid" => $out["uid_${key}"],
"lastname" => $out["lastname_${key}"],
"email" => $out["email_${key}"],
"family_type" => $out["family_type_${key}"],
"status" => $out["status_${key}"],
"firstname" => $out["firstname_${key}"],
);
}
break;
case WRENCHBOARD_FAMILY_SGGESTLIST:
case WRENCHBOARD_FAMILY_SGGESTWAITING:
$total = $out["total_record"];