Fix select
This commit is contained in:
@@ -103,15 +103,24 @@ long jobs_calls(CVars in, CVars &out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
long WrenchJobPostAgree(CVars in, CVars &out) {
|
long WrenchJobPostAgree(CVars in, CVars &out) {
|
||||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
logfmt(logINFO, "WrenchJobPostAgree()");
|
||||||
REQ_STRING(in, "uid", 1, 500, "(.*)"); //uid
|
long ret = PHP_API_BAD_PARAM;
|
||||||
|
try {
|
||||||
if (load_db_record(out, "SELECT * FROM members WHERE id = %lu AND uid='%s' AND post_jobs IS NULL", in["message_id"].Long(), in["uid"].c_str()) ){
|
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||||
pgsql_exec("UPDATE members SET post_jobs = now() WHERE id = %lu AND uid='%s'", in["message_id"].Long(), in["uid"].c_str());
|
REQ_STRING(in, "uid", 1, 500, "(.*)"); //uid
|
||||||
|
if (load_db_record(out, "SELECT id AS member_id, * FROM members WHERE id = %lu AND uid='%s' AND post_jobs IS NULL", in["member_id"].Long(), in["uid"].c_str()) ){
|
||||||
|
if ( out["member_id"].Long() > 0 )
|
||||||
|
{
|
||||||
|
pgsql_exec("UPDATE members SET post_jobs = now() WHERE id = %lu AND uid='%s'", in["message_id"].Long(), in["uid"].c_str());
|
||||||
|
load_db_record(out, "SELECT * FROM members WHERE id = %lu AND uid='%s' AND post_jobs IS NOT NULL", in["member_id"].Long(), in["uid"].c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = PHP_CREATED_OK;
|
||||||
|
} catch (bad_parameter) {
|
||||||
|
out["log_status"] = "Error WrenchMarketInterestQuestion";
|
||||||
}
|
}
|
||||||
|
|
||||||
logfmt(logINFO, "/WrenchJobPostAgree()");
|
logfmt(logINFO, "/WrenchJobPostAgree()");
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user