From 91f8d264e5d8834d38fbd6599830245e52fb6145 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 23 Sep 2023 10:46:34 -0400 Subject: [PATCH] family list --- wrenchboard/src/shared_tool/family_acc.cc | 18 ++++++++++++++++-- www-api/app/Models/ResultFormatter.php | 4 +++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/wrenchboard/src/shared_tool/family_acc.cc b/wrenchboard/src/shared_tool/family_acc.cc index 518841a8..28c80ab6 100644 --- a/wrenchboard/src/shared_tool/family_acc.cc +++ b/wrenchboard/src/shared_tool/family_acc.cc @@ -427,6 +427,11 @@ long WrenchFamilyList(CVars in, CVars &out){ snprintf(vname, sizeof (vname), "task_count_%05d", i); out[vname] = rec["task_count"]; + snprintf(vname, sizeof (vname), "year_%05d", i); + out[vname] = rec["year"]; + + snprintf(vname, sizeof (vname), "month_%05d", i); + out[vname] = rec["month"]; } } ret = PHP_API_OK; @@ -446,13 +451,15 @@ long WrenchFamilyAdd(CVars in, CVars &out){ try { REQ_LONG(in, "member_id", 1, -1); - REQ_LONG(in, "age", 1, -1); + //REQ_LONG(in, "age", 1, -1); + REQ_LONG(in, "year", 1, -1); + REQ_LONG(in, "month", 1, -1); REQ_STRING(in, "firstname", 2, 34, "(.*)"); REQ_STRING(in, "lastname", 2, 34, "(.*)"); CVars x; x["member_id"] = in["member_id"]; x["member_id"].set_valid(true); - x["age"] = in["age"]; + x["age"] = "0"; x["age"].set_valid(true); x["firstname"] = in["firstname"]; x["firstname"].set_valid(true); @@ -460,6 +467,13 @@ long WrenchFamilyAdd(CVars in, CVars &out){ x["lastname"].set_valid(true); x["status"] = "1"; x["status"].set_valid(true); + + x["year"] = in["year"]; + x["year"].set_valid(true); + + x["month"] = in["month"]; + x["month"].set_valid(true); + family_id = insert_db_record(DBS_VALID, "members_family", "members_family_id_seq", x); if (family_id > 0) { load_db_record(out, "SELECT * FROM members_family WHERE id =%lu",family_id); diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index 22c7a1b4..9e6142a0 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -381,7 +381,7 @@ class ResultFormatter extends Model $total = $out["total_record"]; $res = array( "status" => $out["status"], - "total_record" => ($total - 1), + "total_record" => ($total), "internal_return" => $out["internal_return"], "result_list" => array(), ); @@ -392,6 +392,8 @@ class ResultFormatter extends Model "firstname" => $out["firstname_${key}"], "lastname" => $out["lastname_${key}"], "age" => $out["age_${key}"], + "year" => $out["year_${key}"], + "month" => $out["month_${key}"], "last_login" => $out["last_login_${key}"], "task_count" => $out["task_count_${key}"], "pending_task_count" => $out["task_count_${key}"],