切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
何书鹏
4 years ago
提交
fa7bd36961f47059c81a6ed71d33f07519a4704f
1 个父辈
ce5de365
1 个管道 的构建
通过
耗费 2 秒
api更新
变更
2
构建
2
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
13 行增加
和
17 行删除
application/api/controller/v2/User.php
public/api.html
application/api/controller/v2/User.php
查看文件 @
fa7bd36
...
...
@@ -97,7 +97,7 @@ class User extends Api
"work_subsidy": "2.00", //工时补贴(元/小时)
"work_subsidy_month": 0, //本月工时补贴
"lower_work_hours_month": 0, //下级打卡总工时
"
lower_
recruit_subsidy_month": 0, //下级招聘补贴工资
"recruit_subsidy_month": 0, //下级招聘补贴工资
"salary": 0 //本月共收入
}
})
...
...
@@ -105,29 +105,25 @@ class User extends Api
public
function
salary
()
{
$user
=
$this
->
model
->
get
(
$this
->
auth
->
id
);
// 我的本月工时补贴
$work_subsidy_month
=
round
(
$user
[
'work_subsidy'
]
*
$user
[
'work_hours_month'
],
2
);
// 我的下级本月总工时和本月返我的总招聘补贴
$lower_
list
=
$this
->
model
$lower_
work_hours_month
=
$this
->
model
->
where
(
'pid'
,
$user
[
'id'
])
->
where
(
'is_work'
,
'1'
)
->
field
(
'recruit_subsidy,work_hours_month'
)
->
select
();
$lower_work_hours_month
=
0
;
$lower_recruit_subsidy_month
=
0
;
foreach
(
$lower_list
as
$v
){
$lower_work_hours_month
+=
$v
[
'work_hours_month'
];
$lower_recruit_subsidy_month
+=
round
(
$v
[
'recruit_subsidy'
]
*
$v
[
'work_hours_month'
],
2
);
}
->
sum
(
'work_hours_month'
);
// 我的本月共收入
$salary
=
$user
[
'work_salary_month'
]
+
$work_subsidy_month
+
$lower_recruit_subsidy_month
;
$salary
=
UserSalary
::
where
(
'user_id'
,
$user
[
'id'
])
->
where
(
'year_month'
,
date
(
'Y-m'
))
->
value
(
'salary'
);
if
(
!
$salary
){
$salary
=
$user
[
'work_salary_month'
]
+
$user
[
'work_subsidy_month'
]
+
$user
[
'recruit_subsidy_month'
];
}
$data
=
[
'work_hours_month'
=>
$user
[
'work_hours_month'
],
'work_salary_month'
=>
$user
[
'work_salary_month'
],
'work_subsidy'
=>
$user
[
'work_subsidy'
],
'work_subsidy_month'
=>
$
work_subsidy_month
,
'work_subsidy_month'
=>
$
user
[
'work_subsidy_month'
]
,
'lower_work_hours_month'
=>
$lower_work_hours_month
,
'
lower_recruit_subsidy_month'
=>
$lower_recruit_subsidy_month
,
'
recruit_subsidy_month'
=>
$user
[
'recruit_subsidy_month'
]
,
'salary'
=>
$salary
];
$this
->
success
(
'成功'
,
$data
);
...
...
public/api.html
查看文件 @
fa7bd36
...
...
@@ -2408,7 +2408,7 @@
"work_subsidy": "2.00", //工时补贴(元/小时)
"work_subsidy_month": 0, //本月工时补贴
"lower_work_hours_month": 0, //下级打卡总工时
"
lower_
recruit_subsidy_month": 0, //下级招聘补贴工资
"recruit_subsidy_month": 0, //下级招聘补贴工资
"salary": 0 //本月共收入
}
}
</pre>
...
...
@@ -15510,7 +15510,7 @@
<div
class=
"row mt0 footer"
>
<div
class=
"col-md-6"
align=
"left"
>
Generated on 2021-02-0
2 23:35:50
</div>
Generated on 2021-02-0
3 10:12:19
</div>
<div
class=
"col-md-6"
align=
"right"
>
<a
href=
"./"
target=
"_blank"
>
My Website
</a>
</div>
...
...
请
注册
或
登录
后发表评论