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
9b4940dd
Commit
9b4940dd
authored
Aug 23, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 团长分销活动-团长审核接口
parent
e55ad745
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
285 additions
and
5 deletions
+285
-5
ColonelConfigValidate.php
application/library/Validate/ColonelConfigValidate.php
+21
-0
PindanActivityInfo.php
application/models/marketing/mysql/PindanActivityInfo.php
+51
-0
PindanActivityInviteOrder.php
...tion/models/marketing/mysql/PindanActivityInviteOrder.php
+51
-0
PindanActivityInviteOrderNum.php
...n/models/marketing/mysql/PindanActivityInviteOrderNum.php
+51
-0
PindanActivityPayInfo.php
application/models/marketing/mysql/PindanActivityPayInfo.php
+51
-0
Colonel.php
application/modules/Marketing/controllers/Colonel.php
+38
-4
PindanActivityColonelConfigService.php
...services/marketing/PindanActivityColonelConfigService.php
+22
-1
No files found.
application/library/Validate/ColonelConfigValidate.php
0 → 100644
View file @
9b4940dd
<?php
namespace
Validate
;
class
ColonelConfigValidate
extends
BaseValidate
{
protected
$rule
=
[
'date'
=>
'require'
,
'config'
=>
'require'
,
];
protected
$message
=
[
'phone'
=>
'date 参数不能为空'
,
'config'
=>
'config 参数不能为空'
];
public
function
sceneDate
()
{
return
$this
->
only
([
"date"
])
->
append
(
"date"
,
"require"
);
}
}
\ No newline at end of file
application/models/marketing/mysql/PindanActivityInfo.php
0 → 100644
View file @
9b4940dd
<?php
namespace
App\Models\marketing\mysql
;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivityInfo
extends
MysqlBase
{
const
TABLE_NAME
=
'pindan_activity_info'
;
const
CONFIG_INDEX
=
'marketing'
;
const
PRIMARY_KEY
=
'pindan_activity_id'
;
public
static
function
getRecord
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
get
(
$columns
,
$where
,
$options
);
}
public
static
function
getRecordMaster
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
selectMaster
(
$columns
,
$where
,
$options
);
}
public
static
function
insertRecord
(
$columns
,
$options
=
[])
{
return
self
::
insert
(
$columns
,
$options
);
}
public
static
function
updateRecord
(
$columns
,
$where
)
{
return
self
::
update
(
$columns
,
$where
);
}
public
static
function
save
(
$data
,
$where
=
[],
$options
=
[])
{
if
(
empty
(
$where
))
{
return
self
::
insert
(
$data
,
$options
);
}
return
self
::
update
(
$data
,
$where
);
}
public
static
function
deleteRecord
(
$where
)
{
return
self
::
delete
(
$where
);
}
}
\ No newline at end of file
application/models/marketing/mysql/PindanActivityInviteOrder.php
0 → 100644
View file @
9b4940dd
<?php
namespace
App\Models\marketing\mysql
;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivityInviteOrder
extends
MysqlBase
{
const
TABLE_NAME
=
'pindan_activity_invite_order'
;
const
CONFIG_INDEX
=
'marketing'
;
const
PRIMARY_KEY
=
'invite_order_id'
;
public
static
function
getRecord
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
get
(
$columns
,
$where
,
$options
);
}
public
static
function
getRecordMaster
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
selectMaster
(
$columns
,
$where
,
$options
);
}
public
static
function
insertRecord
(
$columns
,
$options
=
[])
{
return
self
::
insert
(
$columns
,
$options
);
}
public
static
function
updateRecord
(
$columns
,
$where
)
{
return
self
::
update
(
$columns
,
$where
);
}
public
static
function
save
(
$data
,
$where
=
[],
$options
=
[])
{
if
(
empty
(
$where
))
{
return
self
::
insert
(
$data
,
$options
);
}
return
self
::
update
(
$data
,
$where
);
}
public
static
function
deleteRecord
(
$where
)
{
return
self
::
delete
(
$where
);
}
}
\ No newline at end of file
application/models/marketing/mysql/PindanActivityInviteOrderNum.php
0 → 100644
View file @
9b4940dd
<?php
namespace
App\Models\marketing\mysql
;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivityInviteOrderNum
extends
MysqlBase
{
const
TABLE_NAME
=
'pindan_activity_invite_order_num'
;
const
CONFIG_INDEX
=
'marketing'
;
const
PRIMARY_KEY
=
'invite_order_num_id'
;
public
static
function
getRecord
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
get
(
$columns
,
$where
,
$options
);
}
public
static
function
getRecordMaster
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
selectMaster
(
$columns
,
$where
,
$options
);
}
public
static
function
insertRecord
(
$columns
,
$options
=
[])
{
return
self
::
insert
(
$columns
,
$options
);
}
public
static
function
updateRecord
(
$columns
,
$where
)
{
return
self
::
update
(
$columns
,
$where
);
}
public
static
function
save
(
$data
,
$where
=
[],
$options
=
[])
{
if
(
empty
(
$where
))
{
return
self
::
insert
(
$data
,
$options
);
}
return
self
::
update
(
$data
,
$where
);
}
public
static
function
deleteRecord
(
$where
)
{
return
self
::
delete
(
$where
);
}
}
\ No newline at end of file
application/models/marketing/mysql/PindanActivityPayInfo.php
0 → 100644
View file @
9b4940dd
<?php
namespace
App\Models\marketing\mysql
;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
PindanActivityPayInfo
extends
MysqlBase
{
const
TABLE_NAME
=
'pindan_activity_pay_info'
;
const
CONFIG_INDEX
=
'marketing'
;
const
PRIMARY_KEY
=
'pindan_activity_pay_info_id'
;
public
static
function
getRecord
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
get
(
$columns
,
$where
,
$options
);
}
public
static
function
getRecordMaster
(
$where
,
$columns
=
[],
$options
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
selectMaster
(
$columns
,
$where
,
$options
);
}
public
static
function
insertRecord
(
$columns
,
$options
=
[])
{
return
self
::
insert
(
$columns
,
$options
);
}
public
static
function
updateRecord
(
$columns
,
$where
)
{
return
self
::
update
(
$columns
,
$where
);
}
public
static
function
save
(
$data
,
$where
=
[],
$options
=
[])
{
if
(
empty
(
$where
))
{
return
self
::
insert
(
$data
,
$options
);
}
return
self
::
update
(
$data
,
$where
);
}
public
static
function
deleteRecord
(
$where
)
{
return
self
::
delete
(
$where
);
}
}
\ No newline at end of file
application/modules/Marketing/controllers/Colonel.php
View file @
9b4940dd
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
use
App\Base\Base
;
use
App\Base\Base
;
use
App\Services\marketing\ColonelService
;
use
App\Services\marketing\ColonelService
;
use
\Validate\ColonelApplyValidate
;
use
\Validate\ColonelApplyValidate
;
use
\Validate\ColonelAuditValidate
;
use
\Validate\ColonelConfigValidate
;
use
\App\Services\marketing\PindanActivityColonelConfigService
;
class
ColonelController
extends
Base
class
ColonelController
extends
Base
{
{
...
@@ -28,10 +29,38 @@ class ColonelController extends Base
...
@@ -28,10 +29,38 @@ class ColonelController extends Base
return
$this
->
success
([
'result'
=>
[
'applyId'
=>
$applyId
]]);
return
$this
->
success
([
'result'
=>
[
'applyId'
=>
$applyId
]]);
}
}
/**
* 编辑团长分销配置
* @throws \App\Exception\custom\MarketingException
* @throws \App\Exception\custom\ParamException
*/
public
function
add_configAction
()
{
(
new
ColonelConfigValidate
())
->
validate
();
$params
=
$this
->
params
;
PindanActivityColonelConfigService
::
editColonelConfig
(
$params
);
return
$this
->
success
();
}
/**
* 查看团长分销配置
* @throws \App\Exception\custom\ParamException
*/
public
function
colonel_configAction
()
{
(
new
ColonelConfigValidate
())
->
scene
(
"date"
)
->
validate
();
$params
=
$this
->
params
;
$data
=
PindanActivityColonelConfigService
::
colonelConfig
(
$params
);
return
$this
->
success
([
"result"
=>
$data
]);
}
/**
/**
* Notes: 管理后台 - 申请团长审核列表
* Notes: 管理后台 - 申请团长审核列表
* User: pengfei@yidian-inc.com
* User: pengfei@yidian-inc.com
* Date: 2021/8/2
0 8:45
下午
* Date: 2021/8/2
3 2:17
下午
* @throws Exception
* @throws Exception
*/
*/
public
function
manage_listAction
()
public
function
manage_listAction
()
...
@@ -41,7 +70,12 @@ class ColonelController extends Base
...
@@ -41,7 +70,12 @@ class ColonelController extends Base
return
$this
->
success
(
$manageList
);
return
$this
->
success
(
$manageList
);
}
}
/**
* Notes: 管理后台 - 申请团长审核
* User: pengfei@yidian-inc.com
* Date: 2021/8/23 2:16 下午
* @throws \App\Exception\custom\MarketingException
*/
public
function
manage_auditAction
()
public
function
manage_auditAction
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
...
@@ -49,4 +83,4 @@ class ColonelController extends Base
...
@@ -49,4 +83,4 @@ class ColonelController extends Base
ColonelService
::
handleManageAudit
(
$params
[
'colonel_apply_id'
],
$params
[
'audit_status'
]);
ColonelService
::
handleManageAudit
(
$params
[
'colonel_apply_id'
],
$params
[
'audit_status'
]);
return
$this
->
success
();
return
$this
->
success
();
}
}
}
}
\ No newline at end of file
application/services/marketing/PindanActivityColonelConfigService.php
View file @
9b4940dd
...
@@ -12,7 +12,7 @@ class PindanActivityColonelConfigService
...
@@ -12,7 +12,7 @@ class PindanActivityColonelConfigService
/**
/**
* 编辑团长分销活动配置
* 编辑团长分销活动配置
* @param array $params
* @param array $params
* @return
\Api\PhpUtils\Mysql\MysqlBase
* @return
bool
* @throws MarketingException
* @throws MarketingException
*/
*/
public
static
function
editColonelConfig
(
$params
=
[])
public
static
function
editColonelConfig
(
$params
=
[])
...
@@ -53,9 +53,30 @@ class PindanActivityColonelConfigService
...
@@ -53,9 +53,30 @@ class PindanActivityColonelConfigService
return
true
;
return
true
;
}
}
/**
* 团长分销活动配置
* @param array $params
* @return array
*/
public
static
function
colonelConfig
(
$params
=
[])
public
static
function
colonelConfig
(
$params
=
[])
{
{
$day
=
empty
(
$params
[
"date"
])
?
date
(
"Y-m-d"
)
:
$params
[
"date"
];
$type
=
empty
(
$params
[
"type"
])
?
PindanActivityColonelConfig
::
TYPE_COLONEL
:
$params
[
"type"
];
$list
=
PindanActivityColonelConfig
::
select
(
"*"
,
[
"date"
=>
$day
,
"type"
=>
$type
],
[]);
$data
=
[];
if
(
!
empty
(
$list
))
{
foreach
(
$list
as
$key
=>
$item
)
{
$data
[
$key
][
"colonel_config_id"
]
=
$item
[
"colonel_config_id"
];
$data
[
$key
][
"date"
]
=
$item
[
"date"
];
$data
[
$key
][
"level"
]
=
$item
[
"level"
];
$data
[
$key
][
"assess_order_num"
]
=
$item
[
"assess_order_num"
];
$data
[
$key
][
"reward_amount"
]
=
$item
[
"reward_amount"
];
}
$sortKeys
=
array_column
(
$data
,
"level"
);
array_multisort
(
$sortKeys
,
SORT_ASC
,
$data
);
}
return
$data
;
}
}
}
}
\ No newline at end of file
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