Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lzzzzl
/
PipData
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5340cd82
authored
Mar 29, 2022
by
刘豪
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更改crm连接的order数据库为从库
parent
00fc7960
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
pipeline/pi_daily.py
translate/ts_crm.py
pipeline/pi_daily.py
View file @
5340cd82
...
...
@@ -582,11 +582,11 @@ class PiDaily:
start_time
=
0
end_time
=
DateHandler
.
now_datetime
()
lx_order_db
=
ConnList
.
LxOrderDb
()
#
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
)
ts_user
=
TsCrm
(
wr_db
,
user
)
ts_user
.
handle_data
()
...
...
translate/ts_crm.py
View file @
5340cd82
...
...
@@ -9,14 +9,29 @@ from extract.ex_erp import ExERP
class
TsCrm
:
def
__init__
(
self
,
db
,
wr_db
,
data
):
def
__init__
(
self
,
wr_db
,
data
):
self
.
dd
=
{}
self
.
db
=
db
self
.
cursor
=
self
.
db
.
cursor
(
cursor
=
pymysql
.
cursors
.
DictCursor
)
self
.
wr_db
=
wr_db
self
.
wr_db_cursor
=
self
.
wr_db
.
cursor
()
self
.
data
=
data
self
.
exchange
=
ExERP
(
DateHandler
.
now_date
(
0
,
1
))
.
get_erp_exchange
()
self
.
create_time
=
DateHandler
.
date_time
(
0
)
self
.
conn_db
()
def
conn_db
(
self
):
conf
=
{
'host'
:
"business-slave.ichunt.db"
,
'port'
:
3306
,
'user'
:
"ReadOdersD"
,
'password'
:
"RLssy2@@!!@$#yttz"
,
'db'
:
"liexin_order"
,
'charset'
:
'utf8'
}
try
:
self
.
db
=
pymysql
.
connect
(
**
conf
)
self
.
cursor
=
self
.
db
.
cursor
(
cursor
=
pymysql
.
cursors
.
DictCursor
)
except
Exception
as
e
:
print
(
"连接{}数据库失败{}"
.
format
(
conf
[
"host"
],
e
))
def
__del__
(
self
):
if
self
.
cursor
:
...
...
@@ -182,10 +197,9 @@ class TsCrm:
print
(
e
)
def
iap_data
(
self
,
outter_uids
):
create_time
=
DateHandler
.
date_time
(
0
)
for
outter_uid
in
outter_uids
:
try
:
self
.
dd
[
outter_uid
][
'create_time'
]
=
create_time
self
.
dd
[
outter_uid
][
'create_time'
]
=
self
.
create_time
sql
=
"SELECT 1 FROM lie_user_extend WHERE outter_uid =
%
d"
%
outter_uid
is_exist
=
self
.
read
(
self
.
wr_db_cursor
,
self
.
wr_db
,
sql
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment