切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
何书鹏
4 years ago
提交
bf9fd47abbf8830edba4f9907e9019a868bcfcf1
1 个父辈
29696abc
1 个管道 的构建
通过
耗费 3 秒
api更新
变更
2
构建
2
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
55 行增加
和
43 行删除
application/api/controller/v2/User.php
public/api.html
application/api/controller/v2/User.php
查看文件 @
bf9fd47
...
...
@@ -86,25 +86,15 @@ class User extends Api
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "16
06137472
",
"time": "16
12234313
",
"data": {
"user": { //用户信息
"id": 1, //用户ID
"nickname": "admin", //昵称
"mobile": "13888888888", //手机号
"avatar": "/uploads/20201123/8894d62100f2f920ffb2f38063b63f2d.jpg", //原始头像地址
"is_work": "0", //是否在职:0=否,1=是
"work_subsidy": "2.00", //工时补贴价格(元/时)
"work_subsidy_month": "600.00", //工时月工资(元/月)
"recruit_subsidy_month": "300.00", //招聘月工资(元/月)
"url": "/u/1",
"full_avatar": "http://www.recruit.top/uploads/20201123/8894d62100f2f920ffb2f38063b63f2d.jpg", //完整头像地址
},
"recruit_subsidy": {
"hour": "1.00", //招聘补贴价格(元/时)
"day": "10.00", //招聘补贴价格(元/天)
"month": "300.00" //招聘补贴价格(元/月)
}
"work_hours_month": "0.0", //本月打卡总工时
"work_salary_month": "0.00", //本月打卡工资
"work_subsidy": "2.00", //工时补贴(元/小时)
"work_subsidy_month": 0, //本月工时补贴
"lower_work_hours_month": 0, //下级打卡总工时
"lower_recruit_subsidy_month": 0, //下级招聘补贴工资
"salary": 0 //本月共收入
}
})
*/
...
...
@@ -1142,6 +1132,12 @@ class User extends Api
"avatar": "http://www.recruit.top/uploads/20201123/8894d62100f2f920ffb2f38063b63f2d.jpg", //头像
"is_work": "0", //是否在职
"is_complete": "0", //补贴是否完成:0=否,1=是
"recruit_subsidy_month": 2, //工资
"work_hours_month": "0.0", //本月总工时
"factory": { //工厂
"id": 1, //工厂ID
"factory_shortname": "" //工厂简称
}
}]
}
})
...
...
@@ -1182,7 +1178,7 @@ class User extends Api
$where
[
'nickname'
]
=
[
'like'
,
'%'
.
$keyword
.
'%'
];
}
$data
=
$this
->
model
->
with
([
'
job
'
])
->
with
([
'
factory
'
])
->
where
(
$where
)
->
order
(
'createtime desc'
)
->
paginate
(
$page_num
,
false
,[
'page'
=>
$page
])
...
...
@@ -1191,7 +1187,7 @@ class User extends Api
$v
[
'mobile'
]
=
substr_replace
(
$v
[
'mobile'
],
'*****'
,
3
,
5
);
}
$v
->
recruit_subsidy_month
=
round
(
$v
[
'recruit_subsidy'
],
$v
[
'work_hours_month'
],
2
);
$v
->
visible
([
'id'
,
'avatar'
,
'nickname'
,
'is_work'
,
'mobile'
,
'is_complete'
,
'
recruit_subsidy'
,
'work_hours_month'
,
'recruit_subsidy_month'
,
'job
'
]);
$v
->
visible
([
'id'
,
'avatar'
,
'nickname'
,
'is_work'
,
'mobile'
,
'is_complete'
,
'
work_hours_month'
,
'recruit_subsidy_month'
,
'factory
'
]);
})
->
toArray
();
$this
->
success
(
'成功'
,
$data
);
}
...
...
@@ -1264,6 +1260,10 @@ class User extends Api
"avatar": "http://www.recruit.top/uploads/20201123/8894d62100f2f920ffb2f38063b63f2d.jpg", //头像
"is_work": "0", //是否在职:0=否,1=是
"is_complete": "0", //补贴是否完成:0=否,1=是
"factory": { //工厂
"id": 1, //工厂ID
"factory_shortname": "" //工厂简称
}
},
"list": { //下级的下级
"total": 3, //总数据
...
...
@@ -1277,6 +1277,12 @@ class User extends Api
"avatar": "", //头像
"is_work": "1", //是否在职:0=否,1=是
"is_complete": "0", //补贴是否完成:0=否,1=是
"recruit_subsidy_month": 2, //工资
"work_hours_month": "0.0", //本月总工时
"factory": { //工厂
"id": 1, //工厂ID
"factory_shortname": "" //工厂简称
}
}]
}
}
...
...
@@ -1289,7 +1295,7 @@ class User extends Api
$page_num
=
$this
->
request
->
param
(
'page_num'
,
10
,
'intval'
);
$is_work
=
$this
->
request
->
param
(
'is_work'
);
//是否在职:0=否,1=是
empty
(
$user_id
)
&&
$this
->
error
(
'缺少必需参数'
);
$user
=
$this
->
model
->
get
(
$user_id
,[
'
job
'
]);
$user
=
$this
->
model
->
get
(
$user_id
,[
'
factory
'
]);
empty
(
$user
)
&&
$this
->
error
(
'下级用户信息不存在'
);
// 可查看下级
...
...
@@ -1305,7 +1311,7 @@ class User extends Api
$where
[
'is_work'
]
=
$is_work
;
}
$list
=
$this
->
model
->
with
([
'
job
'
])
->
with
([
'
factory
'
])
->
where
(
$where
)
->
order
(
'createtime desc'
)
->
paginate
(
$page_num
,
false
,[
'page'
=>
$page
])
...
...
@@ -1314,12 +1320,12 @@ class User extends Api
$v
[
'mobile'
]
=
substr_replace
(
$v
[
'mobile'
],
'*****'
,
3
,
5
);
}
$v
->
recruit_subsidy_month
=
round
(
$v
[
'recruit_subsidy'
],
$v
[
'work_hours_month'
],
2
);
$v
->
visible
([
'id'
,
'avatar'
,
'nickname'
,
'is_work'
,
'mobile'
,
'is_complete'
,
'work_hours_month'
,
'recruit_subsidy_month'
,
'
job
'
]);
$v
->
visible
([
'id'
,
'avatar'
,
'nickname'
,
'is_work'
,
'mobile'
,
'is_complete'
,
'work_hours_month'
,
'recruit_subsidy_month'
,
'
factory
'
]);
})
->
toArray
();
if
(
Validate
::
regex
(
$user
[
'mobile'
],
"^1\d
{
10
}
$"
)){
$user
[
'mobile'
]
=
substr_replace
(
$user
[
'mobile'
],
'*****'
,
3
,
5
);
}
$user
->
visible
([
'id'
,
'avatar'
,
'nickname'
,
'is_work'
,
'mobile'
,
'is_complete'
,
'
job
'
]);
$user
->
visible
([
'id'
,
'avatar'
,
'nickname'
,
'is_work'
,
'mobile'
,
'is_complete'
,
'
factory
'
]);
$this
->
success
(
'成功'
,
compact
(
'user'
,
'list'
));
}
...
...
public/api.html
查看文件 @
bf9fd47
...
...
@@ -2239,25 +2239,15 @@
<pre
id=
"sample_response70"
>
{
"code": 1,
"msg": "成功",
"time": "16
06137472
",
"time": "16
12234313
",
"data": {
"user": { //用户信息
"id": 1, //用户ID
"nickname": "admin", //昵称
"mobile": "13888888888", //手机号
"avatar": "/uploads/20201123/8894d62100f2f920ffb2f38063b63f2d.jpg", //原始头像地址
"is_work": "0", //是否在职:0=否,1=是
"work_subsidy": "2.00", //工时补贴价格(元/时)
"work_subsidy_month": "600.00", //工时月工资(元/月)
"recruit_subsidy_month": "300.00", //招聘月工资(元/月)
"url": "/u/1",
"full_avatar": "http://www.recruit.top/uploads/20201123/8894d62100f2f920ffb2f38063b63f2d.jpg", //完整头像地址
},
"recruit_subsidy": {
"hour": "1.00", //招聘补贴价格(元/时)
"day": "10.00", //招聘补贴价格(元/天)
"month": "300.00" //招聘补贴价格(元/月)
}
"work_hours_month": "0.0", //本月打卡总工时
"work_salary_month": "0.00", //本月打卡工资
"work_subsidy": "2.00", //工时补贴(元/小时)
"work_subsidy_month": 0, //本月工时补贴
"lower_work_hours_month": 0, //下级打卡总工时
"lower_recruit_subsidy_month": 0, //下级招聘补贴工资
"salary": 0 //本月共收入
}
}
</pre>
</div>
...
...
@@ -4829,6 +4819,12 @@
"avatar": "http://www.recruit.top/uploads/20201123/8894d62100f2f920ffb2f38063b63f2d.jpg", //头像
"is_work": "0", //是否在职
"is_complete": "0", //补贴是否完成:0=否,1=是
"recruit_subsidy_month": 2, //工资
"work_hours_month": "0.0", //本月总工时
"factory": { //工厂
"id": 1, //工厂ID
"factory_shortname": "" //工厂简称
}
}]
}
}
</pre>
...
...
@@ -5235,6 +5231,10 @@
"avatar": "http://www.recruit.top/uploads/20201123/8894d62100f2f920ffb2f38063b63f2d.jpg", //头像
"is_work": "0", //是否在职:0=否,1=是
"is_complete": "0", //补贴是否完成:0=否,1=是
"factory": { //工厂
"id": 1, //工厂ID
"factory_shortname": "" //工厂简称
}
},
"list": { //下级的下级
"total": 3, //总数据
...
...
@@ -5248,6 +5248,12 @@
"avatar": "", //头像
"is_work": "1", //是否在职:0=否,1=是
"is_complete": "0", //补贴是否完成:0=否,1=是
"recruit_subsidy_month": 2, //工资
"work_hours_month": "0.0", //本月总工时
"factory": { //工厂
"id": 1, //工厂ID
"factory_shortname": "" //工厂简称
}
}]
}
}
...
...
@@ -15326,7 +15332,7 @@
<div
class=
"row mt0 footer"
>
<div
class=
"col-md-6"
align=
"left"
>
Generated on 2021-02-02 1
0:51:06
</div>
Generated on 2021-02-02 1
1:07:27
</div>
<div
class=
"col-md-6"
align=
"right"
>
<a
href=
"./"
target=
"_blank"
>
My Website
</a>
</div>
...
...
请
注册
或
登录
后发表评论