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
997b773d
Commit
997b773d
authored
Jul 09, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:Set
parent
98dbb667
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
MarketingException.php
application/exception/custom/MarketingException.php
+1
-0
MarketingService.php
application/services/marketing/MarketingService.php
+6
-2
No files found.
application/exception/custom/MarketingException.php
View file @
997b773d
...
...
@@ -26,5 +26,6 @@ class MarketingException extends BaseException
12
=>
'勾选商品不能为空'
,
13
=>
'商品在其他互动已勾选'
,
14
=>
'开始时间不能大于等于结束时间'
,
15
=>
'分润比例不能大于50%'
,
];
}
\ No newline at end of file
application/services/marketing/MarketingService.php
View file @
997b773d
...
...
@@ -173,14 +173,18 @@ class MarketingService
public
static
function
addMarketing
(
$params
){
$marketingName
=
!
empty
(
$params
[
'marketing_name'
])
?
$params
[
'marketing_name'
]
:
''
;
$firstCommissionRate
=
!
empty
(
$params
[
'first_commission_value'
])
?
$params
[
'first_commission_value'
]
*
100
:
''
;
$secondCommissionRate
=
!
empty
(
$params
[
'second_commission_value'
])
?
$params
[
'second_commission_value'
]
*
100
:
''
;
$firstCommissionRate
=
!
empty
(
$params
[
'first_commission_value'
])
?
$params
[
'first_commission_value'
]
*
100
:
0
;
$secondCommissionRate
=
!
empty
(
$params
[
'second_commission_value'
])
?
$params
[
'second_commission_value'
]
*
100
:
0
;
$createUserEmail
=
!
empty
(
$params
[
'op_cur_user'
])
?
$params
[
'op_cur_user'
]
:
''
;
$startTime
=
!
empty
(
$params
[
'start_time'
])
?
$params
[
'start_time'
]
:
''
;
$endTime
=
!
empty
(
$params
[
'end_time'
])
?
$params
[
'end_time'
]
:
''
;
$type
=
!
empty
(
$params
[
'marketing_type'
])
?
$params
[
'marketing_type'
]
:
1
;
$goodsSkuId
=
!
empty
(
$params
[
'goods_sku_id'
])
?
explode
(
","
,
$params
[
'goods_sku_id'
])
:
[];
$rate
=
$firstCommissionRate
+
$secondCommissionRate
;
if
(
$rate
>
5000
)
{
throw
new
MarketingException
([
'cus'
=>
15
]);
}
if
(
empty
(
$goodsSkuId
))
{
throw
new
MarketingException
([
'cus'
=>
12
]);
...
...
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