Commit 595562b0 by 刘豪

更改ts_crm逻辑

parent 197615c8
......@@ -26,7 +26,7 @@ if __name__ == '__main__':
PiGoods.pipeline_zm_warn()
if sys.argv[1] == 'safe_stock':
PiPurchase.pipeline_safe_stock()
if sys.argv[1] == 'search_no_r':
if sys.argv[1] == 'search_no_r': # 每日搜索关键词数据
PiSearch.search_no_result()
if sys.argv[1] == 'sku_expose':
# 获取HDFS数据
......
......@@ -87,8 +87,7 @@ class ConnList(Base):
@staticmethod
def Credit():
conf = credit_server
return pymysql.connect(str(conf['host']), conf['user'], conf['password'],
conf['db_name'], charset='utf8')
return pymysql.connect(**conf)
@staticmethod
def CreditSource():
......@@ -176,8 +175,7 @@ class ConnList(Base):
@staticmethod
def WrCrm():
conf = wr_crm_server
return pymysql.connect(str(conf['host']), conf['user'], conf['password'],
conf['db_name'], charset='utf8')
return pymysql.connect(**conf)
@staticmethod
def LxDb():
......
......@@ -166,14 +166,16 @@ wr_crm_server = {
'host': '172.18.137.21',
'user': 'LxCrmUser',
'password': 'xUTmu0XsdUqoZIim2y',
'db_name': 'liexin_crm'
'db': 'liexin_crm',
'charset': 'utf8'
}
credit_server = {
'host': 'fkdb-master.ichunt.cc',
'user': 'Cdimz200o',
'password': 'mLssyDxmsySZmBomy',
'db_name': 'liexin_credit'
'db': 'liexin_credit',
'charset': 'utf8'
}
credit_source_server = {
......
......@@ -582,24 +582,12 @@ class PiDaily:
start_time = 0
end_time = DateHandler.now_datetime()
# db = ConnList.Order()
lx_order_db = ConnList.LxOrderDb()
wr_db = ConnList.WrCrm()
user = ExCrm('').crm_user(start_time, end_time)
ts_user = TsCrm(lx_order_db, wr_db, user)
print(len(user))
ts_user.is_order()
ts_user.last_order()
ts_user.order_num()
ts_user.model_num()
ts_user.order_amount()
ts_user.paid_amount()
ts_user.contact_info()
ts_user.iap_data()
print(len(user))
ts_user.handle_data()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment