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
f2f599e7
Commit
f2f599e7
authored
Sep 06, 2021
by
suntengda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 获取团长活动配置 默认不传date参数,获取最近配置的一条数据
parent
be68fb37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
ColonelConfigValidate.php
application/library/Validate/ColonelConfigValidate.php
+0
-5
Colonel.php
application/modules/Marketing/controllers/Colonel.php
+0
-2
PindanActivityColonelConfigService.php
...services/marketing/PindanActivityColonelConfigService.php
+9
-2
No files found.
application/library/Validate/ColonelConfigValidate.php
View file @
f2f599e7
...
...
@@ -15,11 +15,6 @@ class ColonelConfigValidate extends BaseValidate
'marketing_id'
=>
'marketing_id 参数不能为空'
,
];
public
function
sceneDate
()
{
return
$this
->
only
([
"date"
])
->
append
(
"date"
,
"require"
);
}
public
function
sceneAdd
()
{
return
$this
->
only
([
"date"
,
"config"
,
"marketing_id"
])
->
append
(
"marketing_id"
,
"require"
);
...
...
application/modules/Marketing/controllers/Colonel.php
View file @
f2f599e7
...
...
@@ -68,8 +68,6 @@ class ColonelController extends Base
*/
public
function
colonel_configAction
()
{
(
new
ColonelConfigValidate
())
->
scene
(
"date"
)
->
validate
();
$params
=
$this
->
params
;
$data
=
PindanActivityColonelConfigService
::
colonelConfig
(
$params
);
return
$this
->
success
([
"result"
=>
$data
]);
...
...
application/services/marketing/PindanActivityColonelConfigService.php
View file @
f2f599e7
...
...
@@ -65,9 +65,16 @@ class PindanActivityColonelConfigService
*/
public
static
function
colonelConfig
(
$params
=
[])
{
$day
=
empty
(
$params
[
"date"
])
?
date
(
"Y-m-d"
)
:
$params
[
"date"
];
$day
=
$params
[
"date"
];
$type
=
empty
(
$params
[
"type"
])
?
ColonelDistributorConfig
::
TYPE_COLONEL
:
$params
[
"type"
];
$config
=
ColonelDistributorConfig
::
getRecord
([
"date"
=>
$day
,
"type"
=>
$type
]);
if
(
empty
(
$day
))
{
//默认取最近更新的一条配置
$config
=
ColonelDistributorConfig
::
getRecord
([
"type"
=>
$type
,
"ORDER"
=>
[
"update_time"
=>
"DESC"
],
"LIMIT"
=>
1
]);
}
else
{
$config
=
ColonelDistributorConfig
::
getRecord
([
"date"
=>
$day
,
"type"
=>
$type
]);
}
if
(
empty
(
$config
))
{
$config
=
ColonelDistributorConfig
::
getRecord
([
"date[<=]"
=>
$day
,
...
...
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