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
85cb8fff
Commit
85cb8fff
authored
Aug 26, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'colonel' of
https://git.yidian-inc.com:8021/bp/goods
into colonel
parents
4b6d4765
40e8d864
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
ColonelConfigValidate.php
application/library/Validate/ColonelConfigValidate.php
+8
-2
Colonel.php
application/modules/Marketing/controllers/Colonel.php
+1
-1
PindanActivityColonelConfigService.php
...services/marketing/PindanActivityColonelConfigService.php
+6
-8
No files found.
application/library/Validate/ColonelConfigValidate.php
View file @
85cb8fff
...
@@ -10,12 +10,18 @@ class ColonelConfigValidate extends BaseValidate
...
@@ -10,12 +10,18 @@ class ColonelConfigValidate extends BaseValidate
];
];
protected
$message
=
[
protected
$message
=
[
'phone'
=>
'date 参数不能为空'
,
'date'
=>
'date 参数不能为空'
,
'config'
=>
'config 参数不能为空'
'config'
=>
'config 参数不能为空'
,
'marketing_id'
=>
'marketing_id 参数不能为空'
,
];
];
public
function
sceneDate
()
public
function
sceneDate
()
{
{
return
$this
->
only
([
"date"
])
->
append
(
"date"
,
"require"
);
return
$this
->
only
([
"date"
])
->
append
(
"date"
,
"require"
);
}
}
public
function
sceneAdd
()
{
return
$this
->
only
([
"date"
,
"config"
,
"marketing_id"
])
->
append
(
"marketing_id"
,
"require"
);
}
}
}
\ No newline at end of file
application/modules/Marketing/controllers/Colonel.php
View file @
85cb8fff
...
@@ -55,7 +55,7 @@ class ColonelController extends Base
...
@@ -55,7 +55,7 @@ class ColonelController extends Base
*/
*/
public
function
add_configAction
()
public
function
add_configAction
()
{
{
(
new
ColonelConfigValidate
())
->
validate
();
(
new
ColonelConfigValidate
())
->
scene
(
'add'
)
->
validate
();
$params
=
$this
->
params
;
$params
=
$this
->
params
;
PindanActivityColonelConfigService
::
editColonelConfig
(
$params
);
PindanActivityColonelConfigService
::
editColonelConfig
(
$params
);
...
...
application/services/marketing/PindanActivityColonelConfigService.php
View file @
85cb8fff
...
@@ -21,6 +21,7 @@ class PindanActivityColonelConfigService
...
@@ -21,6 +21,7 @@ class PindanActivityColonelConfigService
$date
=
$params
[
"date"
];
$date
=
$params
[
"date"
];
$type
=
empty
(
$params
[
"type"
])
?
ColonelDistributorConfig
::
TYPE_COLONEL
:
$params
[
"type"
];
$type
=
empty
(
$params
[
"type"
])
?
ColonelDistributorConfig
::
TYPE_COLONEL
:
$params
[
"type"
];
$configList
=
$params
[
"config"
];
$configList
=
$params
[
"config"
];
$marketingId
=
$params
[
"marketing_id"
];
if
(
empty
(
$configList
))
{
if
(
empty
(
$configList
))
{
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_CONFIG_NULL
]);
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_CONFIG_NULL
]);
...
@@ -29,28 +30,25 @@ class PindanActivityColonelConfigService
...
@@ -29,28 +30,25 @@ class PindanActivityColonelConfigService
if
(
count
(
$configList
)
>
6
)
{
if
(
count
(
$configList
)
>
6
)
{
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_LEVEL_SIX
]);
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_LEVEL_SIX
]);
}
}
ColonelDistributorConfig
::
beginTransaction
();
$idRes
=
ColonelDistributorConfig
::
getRecord
([
"date"
=>
$date
,
"type"
=>
$type
],
[
"colonel_config_id"
]);
$idRes
=
ColonelDistributorConfig
::
getRecord
([
"date"
=>
$date
,
"type"
=>
$type
,
"marketing_id"
=>
$marketingId
],
[
"colonel_config_id"
]);
if
(
!
empty
(
$idRes
))
{
if
(
!
empty
(
$idRes
))
{
ColonelDistributorConfig
::
save
([
ColonelDistributorConfig
::
save
([
"marketing_id"
=>
$marketingId
,
"date"
=>
$date
,
"date"
=>
$date
,
"type"
=>
$type
,
"type"
=>
$type
,
"data"
=>
$configList
,
"data"
=>
$configList
,
],
$idRes
[
"colonel_config_id"
]);
],
[
"colonel_config_id"
=>
$idRes
[
"colonel_config_id"
]
]);
}
else
{
}
else
{
ColonelDistributorConfig
::
save
([
ColonelDistributorConfig
::
save
([
"marketing_id"
=>
$marketingId
,
"date"
=>
$date
,
"date"
=>
$date
,
"type"
=>
$type
,
"type"
=>
$type
,
"data"
=>
$configList
,
"data"
=>
$configList
,
]);
]);
}
}
if
(
!
ColonelDistributorConfig
::
commit
())
{
ColonelDistributorConfig
::
rollback
();
throw
new
MarketingException
([
"cus"
=>
5
]);
}
return
true
;
return
true
;
}
}
...
...
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