36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
from flask import jsonify
|
|
from app.utils.logger import logger
|
|
from app.api.services.base_service import BaseService
|
|
from sqlalchemy import func, desc
|
|
from datetime import datetime, timedelta, timezone
|
|
from app.extensions import db
|
|
from app.models import MembersProducts, Products, Members, ProductsDetails, ProductsDetails, ProvisionActions, Payments, \
|
|
OfficeUsers
|
|
|
|
|
|
class OfficeUsersService(BaseService):
|
|
|
|
@staticmethod
|
|
def get_office_users(filters):
|
|
office_users = OfficeUsers.get_office_users_list()
|
|
office_users_data = []
|
|
if office_users:
|
|
for t in office_users:
|
|
office_users_data.append({
|
|
'id': t.id,
|
|
'uid': t.uid,
|
|
'product_id': t.product_id,
|
|
'description': t.description,
|
|
'name': t.name,
|
|
'status': t.status,
|
|
'added': t.added.isoformat() if t.added else None,
|
|
'updated': t.updated.isoformat() if t.updated else None,
|
|
'banner': t.banner,
|
|
})
|
|
|
|
office_users_result = {
|
|
"office_users": office_users_data,
|
|
}
|
|
|
|
return office_users_result
|