feat: product search
This commit is contained in:
25
test.py
25
test.py
@@ -11,30 +11,7 @@ from models import User, PaymentRecord
|
||||
|
||||
|
||||
async def main():
|
||||
session: AsyncSession = session_maker()
|
||||
try:
|
||||
deal_id = 133
|
||||
source_product_id = 253
|
||||
source_services_stmt = (
|
||||
select(
|
||||
models.DealProductService
|
||||
)
|
||||
.where(
|
||||
models.DealProductService.product_id == source_product_id,
|
||||
models.DealProductService.deal_id == deal_id,
|
||||
)
|
||||
)
|
||||
result = (await session.scalars(source_services_stmt)).all()
|
||||
services = [d.service for d in result]
|
||||
for service in services:
|
||||
print(
|
||||
service.price_ranges
|
||||
|
||||
)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
await session.close()
|
||||
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
Reference in New Issue
Block a user