_sql=""" select user_id as userId, trade_time as tradeTime from trade_record
where inner_merchant_no = '{0}' and trade_type = 3 and status = 1 and trade_time >= '{1}' and trade_time < '{2}'; """.format(store_id,start_time,end_time)
_df=pd.read_sql(_sql,con_vcc_talos)
return_df
defstore_amount(uuid):
"""商户额度"""
_sql=""" select activated_amount,user_id from user_quota_record where uuid = '{0}';""".format(uuid)
_sql="""select amount as amount, trade_type as tradeType from trade_record
where inner_merchant_no = '{0}' and uuid = '{1}'and status = 1 and trade_time >= '{2}' and trade_time < '{3}'; """.format(store_id,uuid,start_time,end_time)
_df=pd.read_sql(_sql,con_vcc_talos)
return_df
defon_uuid_store(uuid,store_id,order_id):
_sql="""select amount from trade_record
where uuid = '{0}' and inner_merchant_no = '{1}' and order_id = '{2}' and trade_type = 3 and status = 1""".format(uuid,store_id,order_id)
_df=pd.read_sql(_sql,con_vcc_talos)
return_df
defstore_type(store_id):
_sql="""select risk_flag as type from inner_merchant_info where inner_merchant_no = '{0}';""".format(store_id)
_df=pd.read_sql(_sql,con_vcc_talos)
return_df
defget_orderid_trade(orderid):
_sql="""select trade_time from trade_record where order_id = '{0}'""".format(orderid)