Sindbad~EG File Manager
�
�
�e[ � �� � d dl mZmZmZmZmZmZmZ d dlm Z m
Z
d dlmZ d dl
Z
eej d dd�� � Z eej d dd�� � Z G d
� d� � ZdS )� )�
create_engine�MetaData�Table�insert�func�select�text)�and_�or_)�appN�DATABASE_URIi� i )� pool_size�pool_recycle�DATABASE_URI_CONFc �2 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�TransactionModelc � � t � � | _ t d| j t �� � | _ t d| j t �� � | _ t d| j t �� � | _ t d| j t �� � | _ d S # t $ r}t |� � Y d }~d S d }~ww xY w)N�zztransaction_api_logs)�
autoload_with� delegates�user_payment�
conference)
r �metar �enginer r r r � Exception�print)�self�es �j/home/numerotech/public_html/conference.numerotech.com/food_kit_scan_badges/core/model/TransactionModel.py�__init__zTransactionModel.__init__ s� � � ��z�z�4�9�!&�'?���Z`�!a�!a�!a�4���+�t�y��G�G�G�4�>��^�T�Y�f�M�M�M�4���<���&�I�I�I�4�?�?�?��
� � � ���8�8�8�8�8�8�8�8�8��������s �BB �
B?�%B:�:B?c �2 � t � � � 5 }|� | j � � � |� � }|� � � t
d� � }|� |� � t
d|z dz t |� � z dz |z dz � � }|� |� � |� � � d d d � � dS # 1 swxY w Y d S # t $ r} t | � � cY d } ~ S d } ~ ww xY w)NzSET SQL_SAFE_UPDATES = 0 ;zE update user_payment set txn_api_updated = 1 , txnapi_updated_at = 'z' where conf_id = z and unique_id = '�' �success) r �connect�executer r �commitr �strr )
r �data� unique_id�conf_id�curr_dt�conn�result�stmt_1�stmtr s
r �SaveTxnAPIDatazTransactionModel.SaveTxnAPIData s� � ������� �D��l�l�4�6�=�=�?�?��F�F�F��K�K�M�M�M��/�0�0�F��L�L������Z�[b�b�cw�w�y|� ~E� zF� zF� F� H\� \� ]f� f� gk� k� l� l�D��L�L������K�K�M�M�M��� � � � � � � � � � � ���� � � � � � ��
� � � ��q�6�6�>�>�>�>�>�>��������sA �C3 �B>C&�C3 �&C*�*C3 �-C*�.C3 �3
D�=D�D�Dc �6 � t � � � 5 }t dt |� � z dz |z dz |z dz � � }|� |� � � � � }|rd� |D � � nd }|cd d d � � S # 1 swxY w Y d S )Nzcselect am_id,conf_id,unique_id,txn_api_updated,txnapi_updated_at from user_payment where conf_id = zS and am_id is not null and txnapi_updated_at is null and date(created_at) between 'z' and 'r"