Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
jd_data_process
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
05d7b70e
authored
Oct 13, 2024
by
larosa
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add update jd attr
parent
24b2b4a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
update_jd_attr.py
update_jd_attr.py
View file @
05d7b70e
...
...
@@ -124,8 +124,8 @@ def update_jd_attr_by_class(conf: dict):
if
len
(
db_result
)
==
0
:
insert_sql
=
"insert into lie_shop_attr (class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time) values (
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s)"
# 谨慎起见 先不插入 防止破坏数据库原数据
#
cursor.execute(query=insert_sql, args=(class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time, ))
#
db.commit()
cursor
.
execute
(
query
=
insert_sql
,
args
=
(
class_id
,
attr_id
,
attr_name
,
unit
,
enum_value
,
input_type
,
is_required
,
status
,
platform
,
create_time
,
))
db
.
commit
()
print
(
insert_sql
%
(
class_id
,
attr_id
,
attr_name
,
unit
,
enum_value
,
input_type
,
is_required
,
status
,
platform
,
create_time
))
# 把sql语句输出到一个文件中
else
:
...
...
@@ -211,8 +211,8 @@ def update_ext_attr_by_class_ids(conf: dict):
if
len
(
db_result
)
==
0
:
# 不存在时
insert_sql
=
"insert into lie_shop_attr (class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time) values (
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s,
%
s)"
#
cursor.execute(query=insert_sql, args=(class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time,))
#
db.commit()
cursor
.
execute
(
query
=
insert_sql
,
args
=
(
class_id
,
attr_id
,
attr_name
,
unit
,
enum_value
,
input_type
,
is_required
,
status
,
platform
,
create_time
,))
db
.
commit
()
print
(
insert_sql
%
(
class_id
,
attr_id
,
attr_name
,
unit
,
enum_value
,
input_type
,
is_required
,
status
,
platform
,
create_time
))
else
:
update_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