add query
This commit is contained in:
@@ -638,7 +638,7 @@ def recent_bar(current_user):
|
||||
# "processing": random.randint(0, 10),
|
||||
# "verifying" : random.randint(0, 10),
|
||||
# "completed" : random.randint(0, 10),
|
||||
#
|
||||
#
|
||||
@app.route("/panel/account/actions")
|
||||
@token_required
|
||||
def recent_actions(current_user):
|
||||
@@ -680,6 +680,20 @@ def recent_actions(current_user):
|
||||
@app.route("/panel/account/products/url")
|
||||
@token_required
|
||||
def product_urls(current_user):
|
||||
print( current_user["user"]["uid"])
|
||||
user_uid = current_user["user"]["uid"]
|
||||
user_id = current_user["user"]["id"]
|
||||
PRODUCT_URL = f"SELECT mp.id AS no, p.name AS description, mp.added::text AS date,mp.internal_url AS url,mp.status FROM members_products mp LEFT JOIN products p ON p.product_id =mp.product_id AND mp.member_id = {user_id}"
|
||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||
cursor.execute(PRODUCT_URL)
|
||||
recent_actions = cursor.fetchall()
|
||||
|
||||
print(recent_actions)
|
||||
actionJS = json.dumps( [dict(ix) for ix in recent_actions] )
|
||||
print(actionJS)
|
||||
array3 = json.loads(actionJS)
|
||||
print(array3)
|
||||
|
||||
url_data = {
|
||||
"last_update": datetime.datetime.utcnow(),
|
||||
"url": [
|
||||
|
||||
Reference in New Issue
Block a user