data fix
This commit is contained in:
+15
-5
@@ -344,7 +344,7 @@ def salary_verifloan2():
|
||||
pin = data["pin"]
|
||||
loan_application_id = data["loan_application_id"]
|
||||
|
||||
loan_read = load_offer(loan,bvn)
|
||||
# loan_read = load_offer(loan,bvn)
|
||||
|
||||
SELECT_ACC = "SELECT id, uid,pin,bvn FROM demo_bank_accounts WHERE bvn='" + bvn + "' AND pin = '" + pin + "' "
|
||||
print(SELECT_ACC)
|
||||
@@ -356,13 +356,14 @@ def salary_verifloan2():
|
||||
account_found = count = len( account )
|
||||
print("10000-a")
|
||||
if account_found == 1 :
|
||||
UPDATE_APPLICATION = "UPDATE loan_apply SET verified = now(), due_date = now(() + '30 days' status=5 WHERE uid::text = '" + loan_application_id + "' AND status = 1"
|
||||
UPDATE_APPLICATION = "UPDATE loan_apply SET verified = now(), due_date = now() + '30 days' , status=5 WHERE uid::text = '" + loan_application_id + "' AND status = 1"
|
||||
print(UPDATE_APPLICATION)
|
||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||
cursor.execute(UPDATE_APPLICATION)
|
||||
|
||||
loan_create(bvn,loan_application_id)
|
||||
loan_schedule = loan_create(bvn,loan_application_id)
|
||||
return {
|
||||
"qr": UPDATE_APPLICATION,
|
||||
"status": "1",
|
||||
"message" : "Loan Verified",
|
||||
"data": account
|
||||
@@ -386,8 +387,17 @@ def salary_verifloan2():
|
||||
"data": None
|
||||
}, 500
|
||||
|
||||
def loan_create(bvn,loan_application_id):
|
||||
pass
|
||||
def loan_create(bvn,loan_application_uid):
|
||||
SELECT_LOAN = "SELECT uid,loan,bvn,amount,added,verified,status,due_date FROM loan_apply WHERE uid::text = '" + loan_application_uid + "' AND bvn ='" + bvn + "' "
|
||||
with connection:
|
||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||
cursor.execute(SELECT_LOAN)
|
||||
select_demoS = cursor.fetchall()
|
||||
|
||||
loan_data = json.dumps( [dict(ix) for ix in select_demoS] )
|
||||
loan_result = json.loads( loan_data )
|
||||
|
||||
return loan_result
|
||||
|
||||
def products():
|
||||
product_data = [
|
||||
|
||||
Reference in New Issue
Block a user