Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spider
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
selection-new
spider
Commits
b1700260
Commit
b1700260
authored
Dec 18, 2025
by
Peng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
c9653dca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
all_connect.py
...s/picture_material/stock_summery/new_stock/all_connect.py
+5
-5
No files found.
wangjing_projects/projects/picture_material/stock_summery/new_stock/all_connect.py
View file @
b1700260
...
...
@@ -173,7 +173,7 @@ class ConnectSpider:
try
:
table_name
=
"stock_image_summary_wj"
# 修改查询语句以匹配你的数据表名称和列名称
query
=
f
"""SELECT account_id,account_secret FROM {table_name} where id = {item_id}"""
query
=
f
"""SELECT account_id,account_secret FROM {table_name} where id = {item_id}
and state=1
"""
print
(
query
)
df_status
=
self
.
db_engine192
.
read_sql
(
query
)
if
len
(
df_status
)
>
0
:
...
...
@@ -192,7 +192,7 @@ class ConnectSpider:
for
i
in
range
(
5
):
try
:
table_name
=
"stock_image_detail_wj"
# 全部下载完成之后删除这个条件
sql_query
=
f
"SELECT image_id FROM {table_name}
where created_time>'2025-12-12'
"
sql_query
=
f
"SELECT image_id FROM {table_name}"
df_status
=
self
.
db_engine192
.
read_sql
(
sql_query
)
image_id
=
list
(
df_status
[
'image_id'
]
.
astype
(
str
))
return
image_id
...
...
@@ -206,7 +206,7 @@ class ConnectSpider:
with
self
.
db_engine192
.
begin
()
as
connection
:
table_name
=
"stock_image_detail_wj"
sql_update
=
f
"UPDATE {table_name} SET state = 3 WHERE image_id ='{image_id}' and state = 2"
print
(
sql_update
,
'
234343434343434343434343434
'
)
print
(
sql_update
,
'
下载完成修改状态为3 .条件为2 的
'
)
connection
.
execute
(
sql_update
)
break
except
Exception
as
e
:
...
...
@@ -223,8 +223,8 @@ class ConnectSpider:
result_df
=
self
.
db_engine192
.
read_then_update
(
select_sql
=
query
,
update_table
=
table_name
,
set_values
=
{
"state"
:
2
},
#
把库存清零
where_keys
=
[
"id"
]
,
# WHERE sku = :sku
set_values
=
{
"state"
:
2
},
#
修改状态下载中。状态为2
where_keys
=
[
"id"
]
)
# print(result_df)
result_list
=
result_df
.
values
.
tolist
()
...
...
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