added number
This commit is contained in:
@@ -608,7 +608,13 @@ def panel_products(current_user):
|
|||||||
# ]
|
# ]
|
||||||
# }
|
# }
|
||||||
# print(products_data)
|
# print(products_data)
|
||||||
PRODUCT_LIST = "SELECT id,uid,product_id,name,description,status,banner, 'Activate Now' AS status_text FROM products ORDER BY id ASC"
|
user_id = current_user["user"]["id"]
|
||||||
|
PRODUCT_LIST = f"""SELECT p.id,p.uid,p.product_id,p.name,p.description,p.status,p.banner,
|
||||||
|
'Activate Now' AS status_text
|
||||||
|
FROM products p
|
||||||
|
LEFT JOIN members_products mp ON mp.product_id = p.product_id
|
||||||
|
WHERE mp.member_id ={user_id}
|
||||||
|
ORDER BY p.id ASC"""
|
||||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||||
cursor.execute(PRODUCT_LIST)
|
cursor.execute(PRODUCT_LIST)
|
||||||
products_list = cursor.fetchall()
|
products_list = cursor.fetchall()
|
||||||
|
|||||||
Reference in New Issue
Block a user