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
6561f19f
Commit
6561f19f
authored
Aug 25, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 团长审核列表接口返回参数
parent
52ffaa92
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
5 deletions
+32
-5
ColonelDistributorColonel.php
...tion/models/marketing/mysql/ColonelDistributorColonel.php
+5
-1
ColonelDistributorColonelApply.php
...models/marketing/mysql/ColonelDistributorColonelApply.php
+1
-1
ColonelService.php
application/services/marketing/ColonelService.php
+26
-3
No files found.
application/models/marketing/mysql/ColonelDistributorColonel.php
View file @
6561f19f
...
...
@@ -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 @
6561f19f
...
...
@@ -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/services/marketing/ColonelService.php
View file @
6561f19f
...
...
@@ -86,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
;
...
...
@@ -109,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
;
}
...
...
@@ -255,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
...
...
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