细节调整

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) { if ($parentCode) {
$parentTask = self::where(['code' => $parentCode])->find(); $parentTask = self::where(['code' => $parentCode])->find();
if (!$parentTask) { if (!$parentTask) {
return error(5, '父任务无效'); return error(8, '父任务无效');
} }
if ($parentTask['deleted']) { if ($parentTask['deleted']) {
return error(6, '父任务在回收站中无法编辑'); return error(6, '父任务在回收站中无法编辑');

View File

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

View File

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