Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
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
bltdc
DataCenter_Core2.1_20190520
Commits
fab7fbdd
Commit
fab7fbdd
authored
Jun 09, 2022
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增功能:新开了3个站点shopify的广告费
parent
5dc3bb15
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
Services.cs
Bailun.DC.SyncShopifyFee/Services.cs
+19
-2
No files found.
Bailun.DC.SyncShopifyFee/Services.cs
View file @
fab7fbdd
...
...
@@ -59,7 +59,7 @@ namespace Bailun.DC.SyncShopifyFee
if
(!
btime
.
HasValue
)
{
btime
=
DateTime
.
Now
.
AddHours
(-
2
);
btime
=
this
.
GetBtime
(
websiteUrl
.
Key
);
}
if
(!
etime
.
HasValue
)
{
...
...
@@ -92,7 +92,7 @@ namespace Bailun.DC.SyncShopifyFee
}
}
p
ublic
void
Save
(
string
website
,
IList
<
response_shopify_fee
>
list
)
p
rivate
void
Save
(
string
website
,
IList
<
response_shopify_fee
>
list
)
{
int
updateCount
=
0
;
int
insertCount
=
0
;
...
...
@@ -122,5 +122,22 @@ namespace Bailun.DC.SyncShopifyFee
Console
.
WriteLine
(
$"同步
{
website
}
shopify广告费新增
{
insertCount
}
条数据,更新
{
updateCount
}
条数据"
);
}
}
private
DateTime
GetBtime
(
string
website
)
{
DateTime
btime
=
DateTime
.
Now
.
AddHours
(-
2
);
using
(
var
db
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_Data
))
{
if
(
db
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
db
.
Open
();
}
string
sql
=
"select DATE_FORMAT(max(ts),'%Y-%m-%d %H:00:00') from dc_base_finance_shopify_fee where website = @website"
;
btime
=
db
.
QueryFirstOrDefault
<
DateTime
?>(
sql
,
new
{
website
=
website
})
??
DateTime
.
Now
.
AddHours
(-
2
);
Console
.
WriteLine
(
$"同步
{
website
}
的shopify广告费开始时间为
{
btime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
return
btime
;
}
}
}
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