diff --git a/wrenchboard/src/shared_tool/family_acc.cc b/wrenchboard/src/shared_tool/family_acc.cc index cd00745e..ac213a56 100644 --- a/wrenchboard/src/shared_tool/family_acc.cc +++ b/wrenchboard/src/shared_tool/family_acc.cc @@ -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"; - } + // } } diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index 66ae2e2b..b3701fbf 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -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"];