Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
773840b3
Commit
773840b3
authored
Aug 17, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:set
parent
a4346e07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
18 deletions
+10
-18
MarketingService.php
application/services/marketing/MarketingService.php
+10
-18
No files found.
application/services/marketing/MarketingService.php
View file @
773840b3
...
...
@@ -24,23 +24,13 @@ class MarketingService
{
const
ONLINE_LIFE_ACCOUNT_ID
=
"19019625839230981"
;
const
ONLINE_LIFE_ACCOUNT_ID_TEST
=
"17963416161910792"
;
const
CHARGEFEE
=
0.006
;
/**
* 写死的自营生活号
* @return string
*/
public
static
function
getPublicLifeAccountId
()
{
/**
$env = \Yaf\Application::app()->environ();
if (in_array($env, ['dev'])) {
$lifeAccountId = "13076446786650120";
} elseif (in_array($env, ['test'])) {
$lifeAccountId = "15559498695737346";
}else {
// $lifeAccountId = self::ONLINE_LIFE_ACCOUNT_ID;
$lifeAccountId = self::ONLINE_LIFE_ACCOUNT_ID_TEST;//测试用
}
*/
$lifeAccountId
=
config
(
'lifeaccount'
,
'life_account_id'
);
return
$lifeAccountId
;
}
...
...
@@ -491,28 +481,30 @@ class MarketingService
throw
new
MarketingException
([
'cus'
=>
5
]);
}
$colums
=
[];
$goodCount
=
!
empty
(
$goodsSkuId
)
?
count
(
$goodsSkuId
)
:
0
;
$goodCount
=
!
empty
(
$goodsSkuId
)
?
count
(
$goodsSkuId
)
:
0
;
$goodsSkuList
=
GoodsSku
::
select
(
'*'
,
[
'goods_sku_id'
=>
$goodsSkuId
]);
foreach
(
$goodsSkuList
as
$key
=>
$value
)
{
$clearPrice
=
!
empty
(
$value
[
"clear_price"
])
?
$value
[
"clear_price"
]
:
0
;
$price
=
!
empty
(
$value
[
"price"
])
?
$value
[
"price"
]
:
0
;
$chargeFee
=
!
empty
(
$price
)
?
bcmul
(
$price
,
self
::
CHARGEFEE
,
2
)
:
0
;
//手续费
if
(
!
empty
(
$clearPrice
)
&&
$clearPrice
>
0
)
{
if
(
$commissionMode
==
Marketing
::
COMMISSION_MODE_RATE
)
{
$commissionTotal
=
(
$firstCommissionRate
+
$secondCommissionRate
)
/
1000
*
$price
;
if
(
$price
-
$commissionTotal
<
$clearPrice
)
{
$commissionTotal
=
(
$firstCommissionRate
+
$secondCommissionRate
)
/
1000
0
*
$price
;
if
(
(
$price
-
$commissionTotal
-
$chargeFee
)
<
$clearPrice
)
{
throw
new
GoodsException
([
'cus'
=>
48
]);
}
}
if
(
$commissionMode
==
Marketing
::
COMMISSION_MODE_FIXED
)
{
$commissionTotal
=
(
$firstCommissionRate
+
$secondCommissionRate
);
if
(
$price
-
$commissionTotal
<
$clearPrice
)
{
$commissionTotal
=
(
$firstCommissionRate
+
$secondCommissionRate
)
/
100
;
if
(
(
$price
-
$commissionTotal
-
$chargeFee
)
<
$clearPrice
)
{
throw
new
GoodsException
([
'cus'
=>
48
]);
}
}
}
$colums
[
$key
][
'marketing_id'
]
=
$marketingId
;
$colums
[
$key
][
'goods_spu_id'
]
=
$value
[
'goods_spu_id'
];
$colums
[
$key
][
'goods_sku_id'
]
=
$value
[
'goods_sku_id'
];
...
...
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