细节调整

Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
vilson 2019-07-17 08:15:38 +08:00
parent be6b100b24
commit 2dfc891057
3 changed files with 29 additions and 3 deletions

View File

@ -238,7 +238,7 @@ class Task extends CommonModel
if ($parentCode) {
$parentTask = self::where(['code' => $parentCode])->find();
if (!$parentTask) {
return error(5, '父任务无效');
return error(8, '父任务无效');
}
if ($parentTask['deleted']) {
return error(6, '父任务在回收站中无法编辑');

View File

@ -42,8 +42,8 @@ class TaskWorkTime extends CommonModel
if (!$beginTime) {
return error(4, '请选择开始时间');
}
if (!$num || !is_numeric($num)) {
return error(5, '请输入有效工时');
if (!$num || $num < 0 || !is_numeric($num)) {
return error(6, '请输入有效工时');
}
$data = [
'create_time' => nowTime(),

View File

@ -464,6 +464,12 @@ class Task extends BasicApi
$this->success('', $list);
}
/**
* 工时间录
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function _taskWorkTimeList()
{
$taskCode = Request::param('taskCode');
@ -477,6 +483,12 @@ class Task extends BasicApi
$this->success('', $workTimeList);
}
/**
* 记录工时
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function saveTaskWorkTime()
{
$param = Request::only('beginTime,num,content,taskCode');
@ -487,6 +499,13 @@ class Task extends BasicApi
$this->success();
}
/**
* 修改工时
* @return array
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function editTaskWorkTime()
{
$param = Request::only('beginTime,num,content');
@ -505,6 +524,13 @@ class Task extends BasicApi
$this->success();
}
/**
* 删除工时
* @return array
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function delTaskWorkTime()
{
$code = Request::param('code');