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
b603b9b2
Commit
b603b9b2
authored
Aug 24, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 团长分销活动 团长管理-列表
parent
c5a301fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
6 deletions
+81
-6
ColonelAddPoint.php
application/library/Validate/ColonelAddPoint.php
+16
-2
ColonelDistributorColonel.php
...tion/models/marketing/mysql/ColonelDistributorColonel.php
+25
-0
Colonel.php
application/modules/Marketing/controllers/Colonel.php
+15
-3
ColonelService.php
application/services/marketing/ColonelService.php
+25
-1
No files found.
application/library/Validate/ColonelAddPoint.php
View file @
b603b9b2
...
@@ -10,16 +10,30 @@ namespace Validate;
...
@@ -10,16 +10,30 @@ namespace Validate;
class
ColonelAddPoint
extends
BaseValidate
class
ColonelAddPoint
extends
BaseValidate
{
{
protected
$rule
=
[
protected
$rule
=
[
'colonel_apply_id'
=>
'require'
,
'longitude'
=>
'require'
,
'latitude'
=>
'require'
,
'location'
=>
'require'
,
'address'
=>
'require'
,
'province'
=>
'require'
,
'city'
=>
'require'
,
'area'
=>
'require'
,
'contact_name'
=>
'require'
,
'contact_name'
=>
'require'
,
'phone'
=>
'isMobile'
,
'phone'
=>
'isMobile'
,
'take_place_name'
=>
'require'
,
'take_place_name'
=>
'require'
,
'address'
=>
'require'
];
];
protected
$message
=
[
protected
$message
=
[
'colonel_apply_id'
=>
'申请id不能为空'
,
'longitude'
=>
'位置经度不能为空'
,
'latitude'
=>
'位置纬度不能为空'
,
'location'
=>
'自提点地址不能为空'
,
'address'
=>
'详细地址不能为空'
,
'province'
=>
'省份不能为空'
,
'city'
=>
'城市不能为空'
,
'area'
=>
'地区不能为空'
,
'contact_name'
=>
'联系人不能为空'
,
'contact_name'
=>
'联系人不能为空'
,
'phone'
=>
'请输入正确的手机号'
,
'phone'
=>
'请输入正确的手机号'
,
'take_place_name'
=>
'自提点名称不能为空'
,
'take_place_name'
=>
'自提点名称不能为空'
,
'address'
=>
'详细地址不能为空'
];
];
}
}
application/models/marketing/mysql/ColonelDistributorColonel.php
View file @
b603b9b2
...
@@ -17,6 +17,9 @@ class ColonelDistributorColonel extends MysqlBase
...
@@ -17,6 +17,9 @@ class ColonelDistributorColonel extends MysqlBase
const
COLONEL_SOURCE_APPLY
=
1
;
//用户申请
const
COLONEL_SOURCE_APPLY
=
1
;
//用户申请
const
COLONEL_SOURCE_ADMIN
=
2
;
//运营添加
const
COLONEL_SOURCE_ADMIN
=
2
;
//运营添加
const
DEFAULT_COLUMN
=
[
'colonel_id'
,
'user_id'
,
'take_place_id'
,
'phone'
,
'contact_name'
,
'colonel_distributor_code'
,
'colonel_source'
];
public
static
function
getRecord
(
array
$where
,
$column
=
'*'
)
public
static
function
getRecord
(
array
$where
,
$column
=
'*'
)
{
{
return
self
::
get
(
$column
,
$where
);
return
self
::
get
(
$column
,
$where
);
...
@@ -32,4 +35,26 @@ class ColonelDistributorColonel extends MysqlBase
...
@@ -32,4 +35,26 @@ class ColonelDistributorColonel extends MysqlBase
$id
=
self
::
insert
(
$column
);
$id
=
self
::
insert
(
$column
);
return
intval
(
$id
);
return
intval
(
$id
);
}
}
public
static
function
getPages
(
array
$where
=
[],
$column
=
'*'
,
int
$page
,
int
$pageSize
,
array
$orderBy
=
[
'colonel_apply_id'
=>
'DESC'
])
{
if
(
empty
(
$column
))
{
$column
=
self
::
DEFAULT_COLUMN
;
}
$data
=
$where
;
$count
=
self
::
count
([],
$where
);
if
(
empty
(
$count
))
{
return
[
'list'
=>
[],
'count'
=>
0
];
}
if
(
!
empty
(
$page
)
&&
!
empty
(
$pageSize
))
{
$offset
=
(
$page
-
1
)
*
$pageSize
;
$data
[
'LIMIT'
]
=
[
$offset
,
$pageSize
];
}
if
(
!
empty
(
$orderBy
))
{
$data
[
'ORDER'
]
=
$orderBy
;
}
$result
=
self
::
select
(
$column
,
$data
);
return
[
'result'
=>
$result
,
'count'
=>
$count
];
}
}
}
application/modules/Marketing/controllers/Colonel.php
View file @
b603b9b2
...
@@ -10,6 +10,7 @@ use App\Services\marketing\ColonelService;
...
@@ -10,6 +10,7 @@ use App\Services\marketing\ColonelService;
use
\Validate\ColonelApplyValidate
;
use
\Validate\ColonelApplyValidate
;
use
\Validate\ColonelConfigValidate
;
use
\Validate\ColonelConfigValidate
;
use
\Validate\ColonelAuditValidate
;
use
\Validate\ColonelAuditValidate
;
use
\Validate\ColonelAddPoint
;
use
\App\Services\marketing\PindanActivityColonelConfigService
;
use
\App\Services\marketing\PindanActivityColonelConfigService
;
use
\App\Services\marketing\PindanActivityInviteOrderService
;
use
\App\Services\marketing\PindanActivityInviteOrderService
;
...
@@ -62,9 +63,20 @@ class ColonelController extends Base
...
@@ -62,9 +63,20 @@ class ColonelController extends Base
* Notes: 管理后台 - 申请团长审核列表
* Notes: 管理后台 - 申请团长审核列表
* User: pengfei@yidian-inc.com
* User: pengfei@yidian-inc.com
* Date: 2021/8/23 2:17 下午
* Date: 2021/8/23 2:17 下午
* @throws Exception
*/
*/
public
function
manage_listAction
()
public
function
manage_colonel_apply_listAction
()
{
$params
=
$this
->
params
;
$manageList
=
ColonelService
::
getManageApplyList
(
$params
);
return
$this
->
success
(
$manageList
);
}
/**
* Notes: 管理后台 - 团长审核列表
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 3:09 下午
*/
public
function
manage_colonel_listAction
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$manageList
=
ColonelService
::
getManageList
(
$params
);
$manageList
=
ColonelService
::
getManageList
(
$params
);
...
@@ -106,7 +118,7 @@ class ColonelController extends Base
...
@@ -106,7 +118,7 @@ class ColonelController extends Base
public
function
manage_add_apply_pointAction
()
public
function
manage_add_apply_pointAction
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
// todo params check
(
new
ColonelAddPoint
())
->
validate
();
ColonelService
::
handleAddTaskPlace
(
$params
);
ColonelService
::
handleAddTaskPlace
(
$params
);
return
$this
->
success
();
return
$this
->
success
();
}
}
...
...
application/services/marketing/ColonelService.php
View file @
b603b9b2
...
@@ -62,7 +62,7 @@ class ColonelService
...
@@ -62,7 +62,7 @@ class ColonelService
* @param array $params
* @param array $params
* @return array
* @return array
*/
*/
public
static
function
getManageList
(
array
$params
)
:
array
public
static
function
getManage
Apply
List
(
array
$params
)
:
array
{
{
$params
=
self
::
getPageParams
(
$params
);
$params
=
self
::
getPageParams
(
$params
);
$result
=
ColonelDistributorColonelApply
::
getPages
([],
ColonelDistributorColonelApply
::
DEFAULT_COLUMN
,
$params
[
'page'
],
$params
[
'page_size'
]);
$result
=
ColonelDistributorColonelApply
::
getPages
([],
ColonelDistributorColonelApply
::
DEFAULT_COLUMN
,
$params
[
'page'
],
$params
[
'page_size'
]);
...
@@ -77,6 +77,30 @@ class ColonelService
...
@@ -77,6 +77,30 @@ class ColonelService
return
$result
;
return
$result
;
}
}
/**
* Notes: 团长列表-后台管理
* User: pengfei@yidian-inc.com
* Date: 2021/8/24 3:04 下午
* @param array $params
* @return array
*/
public
static
function
getManageList
(
array
$params
)
:
array
{
$params
=
self
::
getPageParams
(
$params
);
$result
=
ColonelDistributorColonel
::
getPages
([],
ColonelDistributorColonel
::
DEFAULT_COLUMN
,
$params
[
'page'
],
$params
[
'page_size'
]);
if
(
empty
(
$result
[
'count'
]))
{
return
$result
;
}
$userMap
=
self
::
getUserMap
(
array_column
(
$result
[
'result'
],
'user_id'
));
foreach
(
$result
[
'result'
]
as
&
$applyVal
)
{
$applyVal
[
'user_avatar'
]
=
!
empty
(
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
])
?
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
]
:
''
;
// TODO 昨日收益 总收益
}
unset
(
$applyVal
);
return
$result
;
}
/**
/**
* Notes: 团长申请审核
* Notes: 团长申请审核
* User: pengfei@yidian-inc.com
* User: pengfei@yidian-inc.com
...
...
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