Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
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
newshop
newShopBack
Commits
98c06082
Commit
98c06082
authored
Nov 12, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' of
http://gitlab-ebiz.yiyao365.cn/newshop/newshopback
into development
parents
6c678739
6438a1e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
21 deletions
+7
-21
main.php
backend/config/main.php
+0
-1
ShopUserController.php
backend/controllers/v1/shopuser/ShopUserController.php
+5
-13
ShopUser.php
backend/models/v1/shopuser/ShopUser.php
+2
-7
No files found.
backend/config/main.php
View file @
98c06082
...
...
@@ -62,7 +62,6 @@ return [
'GET,OPTIONS test'
=>
'test'
,
'GET swagger'
=>
'swagger'
,
'POST login'
=>
'login'
,
'GET get'
=>
'get'
,
'GET department'
=>
'department'
,
'GET user-complain'
=>
'user-complain'
,
'GET employee-info'
=>
'employee-info'
,
...
...
backend/controllers/v1/shopuser/ShopUserController.php
View file @
98c06082
...
...
@@ -5,6 +5,7 @@ namespace backend\controllers\v1\shopuser;
use
Yii
;
use
backend\controllers\v1\BaseController
;
use
app\models\v1\shopuser\ShopUser
;
use
yii\web\BadRequestHttpException
;
class
ShopUserController
extends
BaseController
{
...
...
@@ -18,9 +19,8 @@ class ShopUserController extends BaseController
* @OA\GET(
* path="/backend/web/v1/shopuser/shop-users/employee-list",
* tags={"用户&员工接口"},
* summary="员工信息列表",
* summary="员工信息列表
(侯贺政)
",
* description="员工信息列表",
* operationId="returnGetParam",
* @OA\Parameter(name="page",in="query",@OA\Schema(type="int")),
* @OA\Parameter(name="NAME",in="query",@OA\Schema(type="string")),
* @OA\Parameter(name="CODE",in="query",@OA\Schema(type="string")),
...
...
@@ -39,10 +39,7 @@ class ShopUserController extends BaseController
$model
=
new
ShopUser
();
$list
=
$model
->
employeeSearch
(
Yii
::
$app
->
request
->
queryParams
);
if
(
!
$list
)
{
return
[
'message'
=>
'未找到符合条件的数据'
,
'data'
=>
[],
];
throw
new
BadRequestHttpException
(
'未找到符合条件的数据'
);
}
return
$list
;
}
...
...
@@ -51,9 +48,8 @@ class ShopUserController extends BaseController
* @OA\GET(
* path="/backend/web/v1/shopuser/shop-users/employee-info",
* tags={"用户&员工接口"},
* summary="员工信息",
* summary="员工信息
(侯贺政)
",
* description="某员工的信息详情",
* operationId="returnGetParam",
* @OA\Parameter(name="id",in="query",required=true,@OA\Schema(type="string")),
* @OA\Response(response="200",description="
* GUID:用户GUID,
...
...
@@ -73,11 +69,7 @@ class ShopUserController extends BaseController
$model
=
new
ShopUser
();
$data
=
$model
->
employeeInfo
(
$id
);
if
(
!
$data
)
{
Yii
::
$app
->
response
->
statusCode
=
400
;
return
[
'message'
=>
'请求错误,该用户不存在'
,
'data'
=>
[],
];
throw
new
BadRequestHttpException
(
'请求错误,该员工不存在'
);
}
return
$data
;
}
...
...
backend/models/v1/shopuser/ShopUser.php
View file @
98c06082
...
...
@@ -180,11 +180,8 @@ class ShopUser extends BaseModel
*/
public
function
employeeSearch
(
$params
)
{
// $org_guid = Yii::$app->user->identity->ORG_GUID;
//$org_guid = (Yii::$app->redis->get('access_token'))['ORG_GUID'];
$org_guid
=
100
;
$query
=
static
::
find
()
->
select
(
'GUID,NAME,EMPLOYEE_CODE,MOBILE_PHONE,EMPLOYEE_BRANCH_GUID'
)
->
where
([
'
ORG_GUID'
=>
$org_guid
,
'
BELONG'
=>
1
]);
->
where
([
'BELONG'
=>
1
]);
if
(
isset
(
$params
[
'NAME'
])
&&
!
empty
(
$params
[
'NAME'
]))
{
$query
->
andWhere
([
'like'
,
'NAME'
,
$params
[
'NAME'
]]);
...
...
@@ -220,10 +217,8 @@ class ShopUser extends BaseModel
*/
public
function
employeeInfo
(
$id
)
{
// $org_guid = Yii::$app->user->identity->ORG_GUID;
$org_guid
=
100
;
$info
=
static
::
find
()
->
select
(
'GUID,NAME,EMPLOYEE_CODE,MOBILE_PHONE,AGE,CONTACT_SEX,MEMBER_NO,IS_DISTRIBUTOR,EMPLOYEE_IS_MANAGER,EMPLOYEE_BRANCH_GUID'
)
->
where
([
'GUID'
=>
$id
,
'BELONG'
=>
1
,
'ORG_GUID'
=>
$org_guid
])
->
where
([
'GUID'
=>
$id
,
'BELONG'
=>
1
])
->
one
();
return
$info
;
}
...
...
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