Fix Query
This commit is contained in:
@@ -295,7 +295,7 @@ long ReferLinkProcessing(){
|
|||||||
const PGresult *res;
|
const PGresult *res;
|
||||||
//in["promo"].c_str(), in["limit"].Long()
|
//in["promo"].c_str(), in["limit"].Long()
|
||||||
CVars out, in;
|
CVars out, in;
|
||||||
res = pgsql_query(" SELECT substring(refer_link,0,9) AS uid_part,email, id , uid substring(refer_link,9)::INT AS member_id, FROM referlink_signup "
|
res = pgsql_query(" SELECT substring(refer_link,0,9) AS uid_part,email, id ,uid,substring(refer_link,9)::INT AS member_id FROM referlink_signup "
|
||||||
" WHERE status = 1 LIMIT 20");
|
" WHERE status = 1 LIMIT 20");
|
||||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
out["total_record"] = pgsql_num_rows(res);
|
out["total_record"] = pgsql_num_rows(res);
|
||||||
@@ -306,7 +306,7 @@ long ReferLinkProcessing(){
|
|||||||
CVars rec;
|
CVars rec;
|
||||||
map_to_cvars(f, rec);
|
map_to_cvars(f, rec);
|
||||||
|
|
||||||
pgsql_query("UPDATE referlink_signup SET member_id=%lu WHERE id =%lu", rec["member_id"].Long(), rec["id"].Long());
|
pgsql_query("UPDATE referlink_signup SET member_id=%lu, status = 2 WHERE id =%lu", rec["member_id"].Long(), rec["id"].Long());
|
||||||
|
|
||||||
if ( load_db_record(out, "SELECT * from members_pending WHERE refer_link = '%s' ORDER BY id DESC limit 1", rec["refer_link"].c_str())> 0){
|
if ( load_db_record(out, "SELECT * from members_pending WHERE refer_link = '%s' ORDER BY id DESC limit 1", rec["refer_link"].c_str())> 0){
|
||||||
CVars x;
|
CVars x;
|
||||||
|
|||||||
Reference in New Issue
Block a user