This commit is contained in:
CHIEFSOFT\ameye
2025-07-05 15:35:00 -04:00
parent 04444d2182
commit cb6f7397b6
3 changed files with 40 additions and 1 deletions
+2
View File
@@ -50,6 +50,7 @@ class AccountService(BaseService):
member_actions = MembersActions.get_recent_member_actions(1)
member_actions_data = []
product_data =[]
for t in member_actions:
product_data.append({
@@ -115,6 +116,7 @@ class AccountService(BaseService):
"account_name": member.account_name,
"firstname":member.firstname,
"lastname": member.lastname,
"email": member.email,
"room": member.uid,
"token": user_token
}
+29 -1
View File
@@ -34,9 +34,37 @@ class MyProductsService(BaseService):
uid = validated_data.get('uid')
product_id = validated_data.get('product_id')
'''
Table "public.products"
Column | Type | Collation | Nullable | Default
-------------+-----------------------------+-----------+----------+--------------------------------------
id | integer | | not null | nextval('products_id_seq'::regclass)
uid | uuid | | | uuid_generate_v4()
product_id | character varying(25) | | not null |
name | character varying(100) | | not null |
description | character varying(250) | | not null |
status | integer | | | 0
added | timestamp without time zone | | | now()
updated | timestamp without time zone | | | now()
banner | character varying(100) | | |
Indexes:
"products_id_key" UNIQUE CONSTRAINT, btree (id)
"products_name_key" UNIQUE CONSTRAINT, btree (name)
"products_product_id_key" UNIQUE CONSTRAINT, btree (product_id)
Referenced by:
TABLE "members_products" CONSTRAINT "members_products_product_id_fkey" FOREIGN KEY (product_id) REFERENCES products(product_id)
merms_panel=#
'''
product_data = Products.get_product_by_product_id(product_id)
# "banner": "banner.jpg",
myproduct_data = {
"myproudct": {
"banner": "banner.jpg",
"banner": product_data['banner'],
"description": "Product Description - Commitment is something that comes from understanding that everything has its price and then having the willingness to pay that price. This is important because nobody wants to put significant effort into something, only to find out after the fact that the price was too high.The price is something not necessarily defined as financial. It could be time, effort, sacrifice, money or perhaps, something else.",
"internal_url": "",
"price_text": "90 days free and 3.95/Month",
+9
View File
@@ -64,6 +64,15 @@ class Products(db.Model):
raise ValueError(f"No available Products")
return product_list
@classmethod
def get_product_by_product_id(cls, product_id):
"""
Get customer's active loans by loan_id.
"""
productItem = cls.query.filter_by(product_id = product_id).first()
if not productItem:
raise ValueError(f"pProduct with ID {product_id} does not exist.")
return productItem
def to_dict(self):
"""