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
e100af04
Commit
e100af04
authored
Aug 25, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'colonel' into develop
parents
cd92173e
4714e44b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
24 deletions
+83
-24
ColonelDistributorColonel.php
...tion/models/marketing/mysql/ColonelDistributorColonel.php
+5
-1
ColonelDistributorColonelApply.php
...models/marketing/mysql/ColonelDistributorColonelApply.php
+1
-1
Colonel.php
application/modules/Marketing/controllers/Colonel.php
+36
-17
ColonelService.php
application/services/marketing/ColonelService.php
+39
-3
PindanActivityInviteOrderService.php
...n/services/marketing/PindanActivityInviteOrderService.php
+2
-2
No files found.
application/models/marketing/mysql/ColonelDistributorColonel.php
View file @
e100af04
...
...
@@ -25,6 +25,11 @@ class ColonelDistributorColonel extends MysqlBase
return
self
::
get
(
$column
,
$where
);
}
public
static
function
getRecords
(
array
$where
,
$column
=
'*'
)
{
return
self
::
select
(
$column
,
$where
);
}
public
static
function
updateRecord
(
array
$columns
,
array
$where
)
{
return
self
::
update
(
$columns
,
$where
);
...
...
@@ -56,5 +61,4 @@ class ColonelDistributorColonel extends MysqlBase
$result
=
self
::
select
(
$column
,
$data
);
return
[
'result'
=>
$result
,
'count'
=>
$count
];
}
}
application/models/marketing/mysql/ColonelDistributorColonelApply.php
View file @
e100af04
...
...
@@ -19,7 +19,7 @@ class ColonelDistributorColonelApply extends MysqlBase
const
STATUS_PASS
=
1
;
//审核通过
const
STATUS_REJECT
=
2
;
//审核驳回
const
DEFAULT_COLUMN
=
[
'colonel_apply_id'
,
'user_id'
,
'phone'
,
'contact_name'
,
'take_place_name'
,
'province'
,
'city'
,
'area'
,
'location'
];
const
DEFAULT_COLUMN
=
[
'colonel_apply_id'
,
'
audit_status'
,
'
user_id'
,
'phone'
,
'contact_name'
,
'take_place_name'
,
'province'
,
'city'
,
'area'
,
'location'
];
public
static
function
insertRecord
(
array
$column
)
:
int
{
...
...
application/modules/Marketing/controllers/Colonel.php
View file @
e100af04
...
...
@@ -31,7 +31,21 @@ class ColonelController extends Base
$params
=
$this
->
params
;
(
new
ColonelApplyValidate
())
->
validate
();
$applyId
=
ColonelService
::
apply
(
$params
);
return
$this
->
success
([
'result'
=>
[
'applyId'
=>
$applyId
]]);
return
$this
->
success
([
'result'
=>
[
'apply_id'
=>
$applyId
]]);
}
/**
* Notes: 是否已申请
* User: pengfei@yidian-inc.com
* Date: 2021/8/25 9:56 上午
* @throws \App\Exception\custom\ParamException
*/
public
function
is_applyAction
()
{
$params
=
$this
->
params
;
(
new
ColonelCenterValidate
())
->
validate
();
$isApply
=
ColonelService
::
isApply
(
$params
[
'user_id'
]);
return
$this
->
success
([
'result'
=>
[
'is_apply'
=>
$isApply
]]);
}
/**
...
...
@@ -114,15 +128,16 @@ class ColonelController extends Base
/**
* Notes: 管理后台 - 添加自提点信息
* User: pengfei@yidian-inc.com
* Date: 2021/8/2
4 2:44
下午
* Date: 2021/8/2
5 2:52
下午
* @throws \App\Exception\custom\MarketingException
* @throws \App\Exception\custom\ParamException
*/
public
function
manage_add_apply_pointAction
()
{
$params
=
$this
->
params
;
(
new
ColonelAddPoint
())
->
validate
();
ColonelService
::
handleAddTaskPlace
(
$params
);
return
$this
->
success
();
$takePlaceId
=
ColonelService
::
handleAddTaskPlace
(
$params
);
return
$this
->
success
(
[
'result'
=>
[
'take_place_id'
=>
$takePlaceId
]]
);
}
/**
...
...
@@ -167,21 +182,25 @@ class ColonelController extends Base
(
new
ColonelCenterValidate
())
->
validate
();
$params
=
$this
->
params
;
$userId
=
$params
[
"user_id"
];
$wechatInfo
=
UserService
::
userWechatBind
([
"user_id"
=>
$userId
]);
$user
=
[];
if
(
!
empty
(
$wechatInfo
))
{
$user
=
[
"user_id"
=>
$wechatInfo
[
0
][
"user_id"
],
"user_nick"
=>
$wechatInfo
[
0
][
"user_nick"
],
"user_avatar"
=>
$wechatInfo
[
0
][
"user_avatar"
]
];
if
(
!
empty
(
$userId
))
{
$wechatInfo
=
UserService
::
userWechatBind
([
"user_id"
=>
$userId
]);
if
(
!
empty
(
$wechatInfo
))
{
$user
=
[
"user_id"
=>
$wechatInfo
[
0
][
"user_id"
],
"user_nick"
=>
$wechatInfo
[
0
][
"user_nick"
],
"user_avatar"
=>
$wechatInfo
[
0
][
"user_avatar"
]
];
}
$incomeData
=
PindanActivityInviteOrderService
::
incomeStatistics
([
"user_ids"
=>
[
$userId
]]);
$orderNumData
=
PindanActivityInviteOrderService
::
inviteOrderNumberStatistics
([
"user_ids"
=>
[
$userId
]]);
return
$this
->
success
([
"result"
=>
[
"income"
=>
$incomeData
[
$userId
],
"order_num"
=>
$orderNumData
[
$userId
],
"user"
=>
$user
]]);
}
$incomeData
=
PindanActivityInviteOrderService
::
incomeStatistics
([
"user_ids"
=>
[
$userId
]]);
$orderNumData
=
PindanActivityInviteOrderService
::
inviteOrderNumberStatistics
([
"user_ids"
=>
[
$userId
]]);
return
$this
->
success
([
"result"
=>
[
"income"
=>
$incomeData
[
$userId
],
"order_num"
=>
$orderNumData
[
$userId
],
"user"
=>
$user
]]);
return
$this
->
success
([
"result"
=>
[]]);
}
}
application/services/marketing/ColonelService.php
View file @
e100af04
...
...
@@ -57,6 +57,19 @@ class ColonelService
}
}
/**
* Notes: 查看用户是否已申请
* User: pengfei@yidian-inc.com
* Date: 2021/8/25 11:42 上午
* @param int $userId
* @return int
*/
public
static
function
isApply
(
int
$userId
)
:
int
{
$isApply
=
ColonelDistributorColonelApply
::
existUser
(
$userId
);
return
intval
(
$isApply
);
}
/**
* Notes: 团长申请列表-后台管理
...
...
@@ -73,8 +86,16 @@ class ColonelService
return
$result
;
}
$userMap
=
self
::
getUserMap
(
array_column
(
$result
[
'result'
],
'user_id'
));
$takePlaceMap
=
self
::
getColonelTakePlaceMap
(
array_column
(
$result
[
'result'
],
'colonel_apply_id'
));
foreach
(
$result
[
'result'
]
as
&
$applyVal
)
{
$applyVal
[
'user_avatar'
]
=
!
empty
(
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
])
?
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
]
:
''
;
// take_place_status 是否可以添加自提点 - 已审核通过并且未添加过自提点
$applyVal
[
'take_place_status'
]
=
0
;
if
(
$applyVal
[
'audit_status'
]
==
ColonelDistributorColonelApply
::
STATUS_PASS
)
{
if
(
empty
(
$takePlaceMap
[
$applyVal
[
'colonel_apply_id'
]][
'take_place_id'
]))
{
$applyVal
[
'take_place_status'
]
=
1
;
}
}
}
unset
(
$applyVal
);
return
$result
;
...
...
@@ -96,11 +117,13 @@ class ColonelService
return
$result
;
}
$userMap
=
self
::
getUserMap
(
array_column
(
$result
[
'result'
],
'user_id'
));
foreach
(
$result
[
'result'
]
as
&
$
apply
Val
)
{
$
applyVal
[
'user_avatar'
]
=
!
empty
(
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
])
?
$userMap
[
$apply
Val
[
'user_id'
]][
'user_avatar'
]
:
''
;
foreach
(
$result
[
'result'
]
as
&
$
colonel
Val
)
{
$
colonelVal
[
'user_avatar'
]
=
!
empty
(
$userMap
[
$colonelVal
[
'user_id'
]][
'user_avatar'
])
?
$userMap
[
$colonel
Val
[
'user_id'
]][
'user_avatar'
]
:
''
;
// TODO 昨日收益 总收益
$colonelVal
[
'yesterday_income'
]
=
0
;
$colonelVal
[
'total_income'
]
=
0
;
}
unset
(
$
apply
Val
);
unset
(
$
colonel
Val
);
return
$result
;
}
...
...
@@ -242,6 +265,19 @@ class ColonelService
return
array_column
((
array
)
$userWechatList
,
null
,
'user_id'
);
}
/**
* Notes: 获取团长自提点
* User: pengfei@yidian-inc.com
* Date: 2021/8/20 8:16 下午
* @param array $colonelApplyIds
* @return array
*/
private
static
function
getColonelTakePlaceMap
(
array
$colonelApplyIds
)
:
array
{
$colonels
=
ColonelDistributorColonel
::
getRecords
([
'colonel_apply_id'
=>
$colonelApplyIds
],
[
'colonel_apply_id'
,
'take_place_id'
]);
return
array_column
((
array
)
$colonels
,
'take_place_id'
,
'colonel_apply_id'
);
}
/**
* Notes: 获取默认页码
* User: pengfei@yidian-inc.com
...
...
application/services/marketing/PindanActivityInviteOrderService.php
View file @
e100af04
...
...
@@ -154,12 +154,12 @@ class PindanActivityInviteOrderService
$data
=
[];
foreach
(
$userIds
as
$userId
)
{
$data
[
$userId
][
"yesterday_order_num"
]
=
0
;
$data
[
$userId
][
"all_order_
reward
"
]
=
0
;
$data
[
$userId
][
"all_order_
num
"
]
=
0
;
if
(
!
empty
(
$yesterdayData
[
$userId
]))
{
$data
[
$userId
][
"yesterday_order_num"
]
=
$yesterdayData
[
$userId
][
"num"
];
}
if
(
!
empty
(
$allData
[
$userId
]))
{
$data
[
$userId
][
"all_order_
reward
"
]
=
$allData
[
$userId
][
"num"
];
$data
[
$userId
][
"all_order_
num
"
]
=
$allData
[
$userId
][
"num"
];
}
}
return
$data
;
...
...
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