family list
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}"],
|
||||
|
||||
Reference in New Issue
Block a user