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
2ea3809a
Commit
2ea3809a
authored
Jul 29, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:临时提交
parent
3fb1e7bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
15 deletions
+43
-15
Marketing.php
application/models/marketing/mysql/Marketing.php
+1
-0
MarketingService.php
application/services/marketing/MarketingService.php
+42
-15
No files found.
application/models/marketing/mysql/Marketing.php
View file @
2ea3809a
...
@@ -13,6 +13,7 @@ class Marketing extends MysqlBase
...
@@ -13,6 +13,7 @@ class Marketing extends MysqlBase
const
MARKETING_TYPE_FENXIAO
=
1
;
const
MARKETING_TYPE_FENXIAO
=
1
;
const
MARKETING_TYPE_TUANGOU
=
2
;
const
MARKETING_TYPE_TUANGOU
=
2
;
const
MARKETING_TYPE_MIAOSHA
=
3
;
const
MARKETING_TYPE_MIAOSHA
=
3
;
const
MARKETING_TYPE_JIELONG
=
4
;
public
static
function
getRecord
(
$where
,
$colums
=
[])
public
static
function
getRecord
(
$where
,
$colums
=
[])
{
{
...
...
application/services/marketing/MarketingService.php
View file @
2ea3809a
...
@@ -173,13 +173,35 @@ class MarketingService
...
@@ -173,13 +173,35 @@ class MarketingService
}
}
/**
/**
* 创建互动
* 创建活动
*
* @param $params
* @param $params
* @return array|mixed
* @return \Api\PhpUtils\Mysql\MysqlBase|array
* @throws MarketingException
* @throws \App\Exception\custom\CodeSpecialException
*/
*/
public
static
function
addMarketing
(
$params
){
public
static
function
addMarketing
(
$params
)
{
$marketingType
=
!
empty
(
$params
[
'marketing_type'
])
?
$params
[
'marketing_type'
]
:
Marketing
::
MARKETING_TYPE_FENXIAO
;
if
(
$marketingType
==
Marketing
::
MARKETING_TYPE_FENXIAO
)
{
return
self
::
addFenxiaoMarketing
(
$params
);
}
else
if
(
$marketingType
==
Marketing
::
MARKETING_TYPE_TUANGOU
)
{
return
[];
}
else
if
(
$marketingType
==
Marketing
::
MARKETING_TYPE_MIAOSHA
)
{
return
[];
}
else
if
(
$marketingType
==
Marketing
::
MARKETING_TYPE_JIELONG
)
{
return
self
::
addJielongMarketing
(
$params
);
}
}
/**
* 增加分销活动
* @param $params
* @return \Api\PhpUtils\Mysql\MysqlBase
* @throws MarketingException
* @throws \App\Exception\custom\CodeSpecialException
*/
private
static
function
addFenxiaoMarketing
(
$params
)
{
$marketingName
=
!
empty
(
$params
[
'marketing_name'
])
?
$params
[
'marketing_name'
]
:
''
;
$marketingName
=
!
empty
(
$params
[
'marketing_name'
])
?
$params
[
'marketing_name'
]
:
''
;
$firstCommissionRate
=
!
empty
(
$params
[
'first_commission_value'
])
?
$params
[
'first_commission_value'
]
*
100
:
0
;
$firstCommissionRate
=
!
empty
(
$params
[
'first_commission_value'
])
?
$params
[
'first_commission_value'
]
*
100
:
0
;
$secondCommissionRate
=
!
empty
(
$params
[
'second_commission_value'
])
?
$params
[
'second_commission_value'
]
*
100
:
0
;
$secondCommissionRate
=
!
empty
(
$params
[
'second_commission_value'
])
?
$params
[
'second_commission_value'
]
*
100
:
0
;
...
@@ -329,6 +351,11 @@ class MarketingService
...
@@ -329,6 +351,11 @@ class MarketingService
}
}
}
}
private
static
function
addJielongMarketing
(
$params
)
{
return
[];
}
/**
/**
* 更新数据
* 更新数据
*
*
...
...
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