fix uid
This commit is contained in:
@@ -84,7 +84,7 @@ long WrenchSuggestTasks(CVars in, CVars &out){
|
|||||||
REQ_STRING(in, "uid", 3, 150, "(.*)");
|
REQ_STRING(in, "uid", 3, 150, "(.*)");
|
||||||
REQ_STRING(in, "title", 3, 150, "(.*)");
|
REQ_STRING(in, "title", 3, 150, "(.*)");
|
||||||
REQ_STRING(in, "description", 3, 299, "(.*)");
|
REQ_STRING(in, "description", 3, 299, "(.*)");
|
||||||
|
out["suggested_task_id"] ="0";// we will set if all okay
|
||||||
const PGresult *res = pgsql_query("SELECT m.*,mf.uid AS family_uid FROM members m "
|
const PGresult *res = pgsql_query("SELECT m.*,mf.uid AS family_uid FROM members m "
|
||||||
" LEFT JOIN members_family mf ON mf.family_member_id = m.id "
|
" LEFT JOIN members_family mf ON mf.family_member_id = m.id "
|
||||||
" WHERE m.id=%lu AND m.uid='%s'", member_id, in["uid"].c_str());
|
" WHERE m.id=%lu AND m.uid='%s'", member_id, in["uid"].c_str());
|
||||||
@@ -94,8 +94,8 @@ long WrenchSuggestTasks(CVars in, CVars &out){
|
|||||||
map_to_cvars(f, rec);
|
map_to_cvars(f, rec);
|
||||||
ret = PHP_API_OK;
|
ret = PHP_API_OK;
|
||||||
out["status"] = "ACCOUNT FOUND";
|
out["status"] = "ACCOUNT FOUND";
|
||||||
out = rec;
|
//out = rec;
|
||||||
if (rec["family_member_id"] != ""){ // we are sure you are a family now
|
if (rec["family_uid"] != ""){ // we are sure you are a family now
|
||||||
|
|
||||||
CVars xx;
|
CVars xx;
|
||||||
xx["member_id"] = member_id;
|
xx["member_id"] = member_id;
|
||||||
@@ -106,9 +106,9 @@ long WrenchSuggestTasks(CVars in, CVars &out){
|
|||||||
xx["description"].set_valid(true);
|
xx["description"].set_valid(true);
|
||||||
xx["family_uid"] = rec["family_uid"];
|
xx["family_uid"] = rec["family_uid"];
|
||||||
xx["family_uid"].set_valid(true);
|
xx["family_uid"].set_valid(true);
|
||||||
|
|
||||||
|
|
||||||
out["suggested_task_id"] = insert_db_record(DBS_VALID, "members_family_suggesttask", "members_family_suggesttask_id_seq", xx);
|
out["suggested_task_id"] = insert_db_record(DBS_VALID, "members_family_suggesttask", "members_family_suggesttask_id_seq", xx);
|
||||||
|
ret = PHP_API_OK;
|
||||||
|
out["status"] = "OK";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (bad_parameter) {
|
} catch (bad_parameter) {
|
||||||
|
|||||||
Reference in New Issue
Block a user