family enable tracking

This commit is contained in:
CHIEFSOFT\ameye
2023-10-25 11:40:51 -04:00
parent dbe3e6d136
commit 8f14612294
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -389,6 +389,7 @@ long WrenchFamilyWallet(CVars in, CVars &out){
logfmt(logINFO, "ENTER CALL long WrenchFamilyWallet");
char vname[30];
long ret = PHP_API_BAD_PARAM;
long family_member_id = 0;
const PGresult *res0;
try {
@@ -406,6 +407,7 @@ long WrenchFamilyWallet(CVars in, CVars &out){
if (res0 != NULL && pgsql_num_rows(res0) > 0) {
map<const char*, const char*>f = pgsql_fetch_assoc(res0, 0);
map_to_cvars(f, rec0);
family_member_id = rec0["family_member_id"].Long();
}
else{
return 0;
@@ -521,6 +523,10 @@ long WrenchFamilyList(CVars in, CVars &out){
snprintf(vname, sizeof (vname), "month_%05d", i);
out[vname] = rec["month"];
snprintf(vname, sizeof (vname), "enable_traking_%05d", i);
out[vname] = rec["enable_traking"];
}
}
ret = PHP_API_OK;
@@ -587,6 +593,8 @@ long WrenchFamilyUpdate(CVars in, CVars &out){
REQ_STRING(in, "family_uid", 2, 50, "(.*)");
REQ_LONG(in, "year", 1, -1);
REQ_LONG(in, "month", 1, -1);
REQ_LONG(in, "enable_traking", 1, -1);
CVars x;
x["firstname"] = in["firstname"];
x["firstname"].set_valid(true);
@@ -598,6 +606,9 @@ long WrenchFamilyUpdate(CVars in, CVars &out){
x["month"] = in["month"];
x["month"].set_valid(true);
x["enable_traking"] = in["enable_traking"];
x["enable_traking"].set_valid(true);
const PGresult *res = pgsql_query(" SELECT id AS family_id FROM members_family "
" WHERE member_id=%lu AND uid='%s' ", member_id,in["family_uid"].c_str());
if (res != NULL && pgsql_num_rows(res) > 0) {
+1
View File
@@ -411,6 +411,7 @@ class ResultFormatter extends Model
"month" => $out["month_${key}"],
"last_login" => $out["last_login_${key}"],
"task_count" => $out["task_count_${key}"],
"enable_traking"=> $out["enable_traking_${key}"],
"pending_task_count" => $out["task_count_${key}"],
"added" => $out["added_${key}"],
"banner" => 'family.svg',