Commit 0ed993a4 authored by luzhaoyang's avatar luzhaoyang

vcc四期

parent 19b2f896
File added
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
] ]
}, },
"execution_count": 4, "execution_count": 4,
"output_type": "execute_result", "metadata": {},
"metadata": {} "output_type": "execute_result"
} }
], ],
"source": [ "source": [
...@@ -732,8 +732,8 @@ ...@@ -732,8 +732,8 @@
"</div>" "</div>"
] ]
}, },
"output_type": "execute_result", "metadata": {},
"metadata": {} "output_type": "execute_result"
} }
], ],
"source": [ "source": [
...@@ -745,9 +745,7 @@ ...@@ -745,9 +745,7 @@
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": []
""
]
}, },
{ {
"cell_type": "code", "cell_type": "code",
...@@ -1346,16 +1344,16 @@ ...@@ -1346,16 +1344,16 @@
"language_info": { "language_info": {
"codemirror_mode": { "codemirror_mode": {
"name": "ipython", "name": "ipython",
"version": 3.0 "version": 3
}, },
"file_extension": ".py", "file_extension": ".py",
"mimetype": "text/x-python", "mimetype": "text/x-python",
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.0" "version": "3.6.6"
} }
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 2 "nbformat_minor": 2
} }
\ No newline at end of file
No preview for this file type
No preview for this file type
# -*- coding:utf-8 -*-
from features.Base_Features import BaseFeatures as BF
from service.addresss_book_sql import *
import datetime
from service.Sql_vcc import *
import json
import time
from pandas import DataFrame
import numpy as np
class __INIT__(BF):
def __init__(self):
time_now = datetime.datetime.strptime(datetime.datetime.strftime(datetime.datetime.now(),'%Y-%m-%d %H:%M:%S'),'%Y-%m-%d %H:%M:%S')
BF._created_at = time_now #获取用户的手机号
user_detail = getSql_userPhone_one(str(tuple([self.user_id])).replace(',)',')'))
BF._user_id_one = str(tuple(user_detail['user_id'].tolist())).replace(',)',')')
BF._user_phone = user_detail['phone_no'].values[0]
BF.get_phone_white_from = sale_phone_white(BF._user_phone)
class 营销手机号白名单():
""" user_info#registeredFrom 用户注册渠道"""
def feature(self):
_营销手机号白名单 = -9999999
if (self.get_phone_white_from).empty == False:
_营销手机号白名单 = 1
else:
_营销手机号白名单 = 0
self._result['营销手机号白名单']['value'] = _营销手机号白名单
return self._result
...@@ -16,7 +16,7 @@ class __INIT__(BF): ...@@ -16,7 +16,7 @@ class __INIT__(BF):
def get_init(self,user_id,loanId = '',termNo = ''): def get_init(self,user_id,loanId = '',termNo = ''):
if loanId == '' or termNo == '': if loanId == '' or termNo == '':
return None return None
df = get_sql_user_loan_all(user_id) df = get_sql_user_loan_all(str(tuple([user_id])).replace(',)',')'))
df['deadline_new'] = df['deadline_new'].apply(lambda x : datetime.datetime.strftime(x,'%Y-%m-%d')) df['deadline_new'] = df['deadline_new'].apply(lambda x : datetime.datetime.strftime(x,'%Y-%m-%d'))
df['deadline'] = df['deadline'].apply(lambda x : datetime.datetime.strftime(x,'%Y-%m-%d')) df['deadline'] = df['deadline'].apply(lambda x : datetime.datetime.strftime(x,'%Y-%m-%d'))
df['repaid_at'] = df['repaid_at'].apply(lambda x : datetime.datetime.strftime(x,'%Y-%m-%d')) df['repaid_at'] = df['repaid_at'].apply(lambda x : datetime.datetime.strftime(x,'%Y-%m-%d'))
......
...@@ -599,8 +599,17 @@ def day_cross_parts(created_at,uuid): ...@@ -599,8 +599,17 @@ def day_cross_parts(created_at,uuid):
return _df return _df
<<<<<<< Updated upstream
def day_amount_credit(created_at,user_id): def day_amount_credit(created_at,user_id):
"""当日授信总额度""" """当日授信总额度"""
_Sql = """select * from acs_limit_record where create_time <"{0}" and limit_record_type= "New" and user_id = "{1}" """.format(created_at,user_id) _Sql = """select * from acs_limit_record where create_time <"{0}" and limit_record_type= "New" and user_id = "{1}" """.format(created_at,user_id)
_df = pd.read_sql(_Sql,con_vccthree_acsdb) _df = pd.read_sql(_Sql,con_vccthree_acsdb)
=======
def sale_phone_white(phone_no):
"""营销手机号白名单"""
_sql = """ select * from white_list_phone_no where phone_no = {0} and is_enable = 1 """.format(phone_no)
_df = pd.read_sql(_sql, con_realtime_hmd)
>>>>>>> Stashed changes
return _df return _df
\ No newline at end of file
...@@ -51,6 +51,7 @@ if __name__ == "__main__": ...@@ -51,6 +51,7 @@ if __name__ == "__main__":
app.listen(23011) app.listen(23011)
IOLoop.instance().start() IOLoop.instance().start()
<<<<<<< Updated upstream
# from tornado.options import define, options # from tornado.options import define, options
# define("port", default=23010, help="run on the given port ", type=int) # define("port", default=23010, help="run on the given port ", type=int)
...@@ -61,6 +62,17 @@ if __name__ == "__main__": ...@@ -61,6 +62,17 @@ if __name__ == "__main__":
# http_server.bind(options.port) # http_server.bind(options.port)
# http_server.start(num_processes=0) # http_server.start(num_processes=0)
# tornado.ioloop.IOLoop.instance().start() # tornado.ioloop.IOLoop.instance().start()
=======
from tornado.options import define, options
define("port", default=23012, help="run on the given port ", type=int)
define("log_path", default='/tmp', help="log path ", type=str)
tornado.options.parse_command_line()
app = apps()
http_server = tornado.httpserver.HTTPServer(app)
http_server.bind(options.port)
http_server.start(num_processes=0)
tornado.ioloop.IOLoop.instance().start()
>>>>>>> Stashed changes
......
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 to comment