duplicate test
This commit is contained in:
@@ -185,14 +185,17 @@ long WrenchFamilyInvite(CVars in, CVars &out){
|
|||||||
out["invite_id"] ="0";// we will set if all okay
|
out["invite_id"] ="0";// we will set if all okay
|
||||||
// const PGresult *res = pgsql_query("SELECT id FROM members_family_relative "
|
// 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);
|
// " 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 "
|
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){
|
" WHERE LOWER('%s') = LOWER(email) AND member_id= %lu", in["email"].c_str(), member_id);
|
||||||
|
|
||||||
if ( out["prev_entry"].Long()> 0){
|
if ( out["prev_entry"].Long() == 0)
|
||||||
out["status_msg"] = "Duplicate";
|
{
|
||||||
out["status_msg"] = "DUPLICATE";
|
//
|
||||||
}
|
// if ( out["prev_entry"].Long()> 0){
|
||||||
else{
|
// out["status_msg"] = "Duplicate";
|
||||||
|
// out["status_msg"] = "DUPLICATE";
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
CVars xx;
|
CVars xx;
|
||||||
xx["member_id"] = member_id;
|
xx["member_id"] = member_id;
|
||||||
xx["member_id"].set_valid(true);
|
xx["member_id"].set_valid(true);
|
||||||
@@ -215,7 +218,7 @@ long WrenchFamilyInvite(CVars in, CVars &out){
|
|||||||
ret = PHP_API_OK;
|
ret = PHP_API_OK;
|
||||||
out["status"] = "OK";
|
out["status"] = "OK";
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,6 +237,26 @@ class ResultFormatter extends Model
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
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_SGGESTLIST:
|
||||||
case WRENCHBOARD_FAMILY_SGGESTWAITING:
|
case WRENCHBOARD_FAMILY_SGGESTWAITING:
|
||||||
$total = $out["total_record"];
|
$total = $out["total_record"];
|
||||||
|
|||||||
Reference in New Issue
Block a user