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
98cba4e7
Commit
98cba4e7
authored
Aug 24, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:Set
parent
e7c5b626
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
MarketingException.php
application/exception/custom/MarketingException.php
+1
-0
MarketingService.php
application/services/marketing/MarketingService.php
+18
-0
No files found.
application/exception/custom/MarketingException.php
View file @
98cba4e7
...
@@ -38,5 +38,6 @@ class MarketingException extends BaseException
...
@@ -38,5 +38,6 @@ class MarketingException extends BaseException
self
::
TAKE_PLACE_NOT_EXIST
=>
'自提点不存在'
,
self
::
TAKE_PLACE_NOT_EXIST
=>
'自提点不存在'
,
21
=>
"活动开始时间不能大于或者等于结束时间"
,
21
=>
"活动开始时间不能大于或者等于结束时间"
,
22
=>
"自提点不能为空"
,
22
=>
"自提点不能为空"
,
23
=>
'分润金额+手续费不能大于售价金额'
,
];
];
}
}
\ No newline at end of file
application/services/marketing/MarketingService.php
View file @
98cba4e7
...
@@ -502,7 +502,25 @@ class MarketingService
...
@@ -502,7 +502,25 @@ class MarketingService
throw
new
GoodsException
([
'cus'
=>
48
]);
throw
new
GoodsException
([
'cus'
=>
48
]);
}
}
}
}
}
else
{
//比例计算
if
(
$commissionMode
==
Marketing
::
COMMISSION_MODE_RATE
)
{
$commissionTotal
=
(
$firstCommissionRate
+
$secondCommissionRate
)
/
10000
*
$price
;
if
(
$price
>
(
$commissionTotal
+
$chargeFee
))
{
throw
new
MarketingException
([
'cus'
=>
15
]);
}
}
//固定金额
if
(
$commissionMode
==
Marketing
::
COMMISSION_MODE_FIXED
)
{
$commissionTotal
=
(
$firstCommissionRate
+
$secondCommissionRate
);
if
(
$price
>
(
$commissionTotal
+
$chargeFee
))
{
throw
new
MarketingException
([
'cus'
=>
15
]);
}
}
}
}
$colums
[
$key
][
'marketing_id'
]
=
$marketingId
;
$colums
[
$key
][
'marketing_id'
]
=
$marketingId
;
$colums
[
$key
][
'goods_spu_id'
]
=
$value
[
'goods_spu_id'
];
$colums
[
$key
][
'goods_spu_id'
]
=
$value
[
'goods_spu_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