kids list

This commit is contained in:
CHIEFSOFT\ameye
2024-07-23 09:01:45 -04:00
parent 579ac4402e
commit 6f8f050950
2 changed files with 18 additions and 0 deletions
@@ -145,12 +145,14 @@ long WrenchRelativesSettings(CVars in, CVars &out){
try{
REQ_STRING(in, "uid", 3, 150, "(.*)");
REQ_STRING(in, "relative_uid", 3, 150, "(.*)");
out["total_kid"] ="0";
load_db_record(out, "SELECT id AS member_id FROM members WHERE uid::text = '%s' ", in["uid"].c_str());
if ( out["member_id"].Long() > 0)
{
res = pgsql_query("SELECT * FROM family_relative_kids WHERE relative_uid::text = '%s'::text AND member_id=%lu AND add_status > 0", in["relative_uid"].c_str(),out["member_id"].Long() );
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_kid"] = && pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
CVars rec;
@@ -160,6 +162,8 @@ long WrenchRelativesSettings(CVars in, CVars &out){
out[vname] = rec["uid"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchRelativesSettings");
+14
View File
@@ -291,6 +291,20 @@ class ResultFormatter extends Model
);
}
break;
case WRENCHBOARD_RELATIVES_SETTINGS:
$total = $out["total_kid"];
$res = array(
"status" => $out["status"],
"internal_return" => $out["internal_return"],
"kids_list" => array(),
);
for ($i = 0; $i < $total; $i++) {
$key = sprintf("%05d", $i);
$res["kids_list"][] = array(
"family_uid" => $out["family_uid_${key}"]
);
}
break;
case WRENCHBOARD_FAMILY_SAMPLETASKS:
$total = $out["total_record"];
$res = array(