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
be62b04c
Commit
be62b04c
authored
Mar 06, 2023
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台利润增加Etsy广告费
parent
cd3c6fff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
OrdersServices.cs
Bailun.DC.Services/OrdersServices.cs
+34
-0
OrdersController.cs
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
+9
-0
No files found.
Bailun.DC.Services/OrdersServices.cs
View file @
be62b04c
...
@@ -6755,6 +6755,40 @@ namespace Bailun.DC.Services
...
@@ -6755,6 +6755,40 @@ namespace Bailun.DC.Services
#
endregion
#
endregion
public
decimal
ADFee
(
string
platform
,
DateTime
?
start
,
DateTime
?
end
,
bool
isUSD
)
{
var
sqlparam
=
new
DynamicParameters
();
var
sql
=
$" select round(sum(
{(
isUSD
?
"amount_usd"
:
"amount_cny"
)}
),2) as fee from dc_base_profit_ad where 1 = 1"
;
if
(!
string
.
IsNullOrWhiteSpace
(
platform
))
{
sql
+=
" and platform = @platform"
;
sqlparam
.
Add
(
"platform"
,
platform
);
}
if
(
start
.
HasValue
)
{
sql
+=
" and ad_time >= @ad_time"
;
sqlparam
.
Add
(
"ad_time"
,
start
.
Value
);
}
if
(
end
.
HasValue
)
{
sql
+=
" and ad_time < @edate"
;
sqlparam
.
Add
(
"edate"
,
end
.
Value
.
AddDays
(
1
));
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_Data
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
QueryFirstOrDefault
<
decimal
?>(
sql
,
sqlparam
,
null
,
2
*
60
)
??
0
;
return
obj
;
}
}
#
endregion
#
endregion
#
region
Paypal
费
#
region
Paypal
费
...
...
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
View file @
be62b04c
...
@@ -1673,6 +1673,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -1673,6 +1673,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var
ebayPutAwayNew
=
new
dc_base_ebay_transaction
();
//Ebay 上架费
var
ebayPutAwayNew
=
new
dc_base_ebay_transaction
();
//Ebay 上架费
decimal
shopifyFee
=
0
;
//Shopify 广告费
decimal
shopifyFee
=
0
;
//Shopify 广告费
decimal
etsyFee
=
0
;
//Etsy 广告费
var
ADfeeTypeNew
=
new
string
[]
{
var
ADfeeTypeNew
=
new
string
[]
{
"AD_FEE"
,
"PREMIUM_AD_FEES"
"AD_FEE"
,
"PREMIUM_AD_FEES"
...
@@ -1865,6 +1866,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -1865,6 +1866,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
//End Add
//End Add
shopifyFee
=
_service
.
ShopifyAD
(
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
shopifyFee
=
_service
.
ShopifyAD
(
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
etsyFee
=
_service
.
ADFee
(
"Etsy"
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
}
}
else
else
{
{
...
@@ -1915,6 +1917,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -1915,6 +1917,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
//End Add
//End Add
shopifyFee
=
_service
.
ShopifyAD
(
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
shopifyFee
=
_service
.
ShopifyAD
(
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
etsyFee
=
_service
.
ADFee
(
"Etsy"
,
dtstart
,
dtend
,
currency
.
ToUpper
()
==
"USD"
);
}
}
else
else
{
{
...
@@ -2097,6 +2100,12 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -2097,6 +2100,12 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
item
.
profit_total
=
(
item
.
profit_total
-
item
.
adfee
??
0
);
item
.
profit_total
=
(
item
.
profit_total
-
item
.
adfee
??
0
);
item
.
profit_rate
=
(
item
.
amount_sales
-
item
.
amount_prepaid
)
!=
0
?
Math
.
Round
((
item
.
profit_total
/
(
item
.
amount_sales
-
item
.
amount_prepaid
)),
2
)
:
0
;
item
.
profit_rate
=
(
item
.
amount_sales
-
item
.
amount_prepaid
)
!=
0
?
Math
.
Round
((
item
.
profit_total
/
(
item
.
amount_sales
-
item
.
amount_prepaid
)),
2
)
:
0
;
}
}
else
if
(
item
.
platform_type
.
ToLower
()
==
"etsy"
)
//Shopify广告费
{
item
.
adfee
=
etsyFee
;
item
.
profit_total
=
(
item
.
profit_total
-
item
.
adfee
??
0
);
item
.
profit_rate
=
(
item
.
amount_sales
-
item
.
amount_prepaid
)
!=
0
?
Math
.
Round
((
item
.
profit_total
/
(
item
.
amount_sales
-
item
.
amount_prepaid
)),
2
)
:
0
;
}
}
}
else
if
(
statistictype
==
1
)
else
if
(
statistictype
==
1
)
{
{
...
...
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