细节调整
Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
parent
be6b100b24
commit
2dfc891057
@ -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, '父任务在回收站中无法编辑');
|
||||||
|
@ -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(),
|
||||||
|
@ -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');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user