update
This commit is contained in:
parent
d44e65536c
commit
cfd5b4ca6d
@ -58,7 +58,7 @@ class TaskAllocationLogic extends BaseLogic
|
|||||||
'task_type_id' => $taskType['id'], // 任务类别id
|
'task_type_id' => $taskType['id'], // 任务类别id
|
||||||
'cost_project_id' => $taskType['cost_project_id'], // 项目id
|
'cost_project_id' => $taskType['cost_project_id'], // 项目id
|
||||||
'apptime' => $params['apptime'],
|
'apptime' => $params['apptime'],
|
||||||
'annex' => json_encode($params['annex']),
|
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||||
]);
|
]);
|
||||||
// 任务明细
|
// 任务明细
|
||||||
$taskDetail = $params['task_detail'];
|
$taskDetail = $params['task_detail'];
|
||||||
@ -99,7 +99,7 @@ class TaskAllocationLogic extends BaseLogic
|
|||||||
'task_type_id' => $taskType['id'], // 任务类别id
|
'task_type_id' => $taskType['id'], // 任务类别id
|
||||||
'cost_project_id' => $taskType['cost_project_id'], // 项目id
|
'cost_project_id' => $taskType['cost_project_id'], // 项目id
|
||||||
'apptime' => $params['apptime'],
|
'apptime' => $params['apptime'],
|
||||||
'annex' => json_encode($params['annex']),
|
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||||
]);
|
]);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
@ -134,7 +134,6 @@ class TaskAllocationLogic extends BaseLogic
|
|||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
$data = TaskAllocation::with(['taskTypeInfo', 'projectInfo'])->findOrEmpty($params['id'])->toArray();
|
$data = TaskAllocation::with(['taskTypeInfo', 'projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||||
$data['annex'] = json_decode($data['annex'], true);
|
|
||||||
$data['task_detail'] = TaskDetail::where('task_allocation_id', $data['id'])->select()->each(function ($item){
|
$data['task_detail'] = TaskDetail::where('task_allocation_id', $data['id'])->select()->each(function ($item){
|
||||||
$taskTypeInfo = TaskType::findOrEmpty($item['task_type_id'])->toArray();
|
$taskTypeInfo = TaskType::findOrEmpty($item['task_type_id'])->toArray();
|
||||||
$item['task_name'] = $taskTypeInfo['name'];
|
$item['task_name'] = $taskTypeInfo['name'];
|
||||||
|
@ -1,94 +1,96 @@
|
|||||||
<?php
|
<?php
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
// | 开源版本可自由商用,可去除界面版权logo
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
// | 访问官网:https://www.likeadmin.cn
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
// | likeadmin团队 版权所有 拥有最终解释权
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | author: likeadminTeam
|
// | author: likeadminTeam
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace app\adminapi\validate\task;
|
namespace app\adminapi\validate\task;
|
||||||
|
|
||||||
|
|
||||||
use app\common\validate\BaseValidate;
|
use app\common\validate\BaseValidate;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TaskAllocation验证器
|
* TaskAllocation验证器
|
||||||
* Class TaskAllocationValidate
|
* Class TaskAllocationValidate
|
||||||
* @package app\adminapi\validate\task
|
* @package app\adminapi\validate\task
|
||||||
*/
|
*/
|
||||||
class TaskAllocationValidate extends BaseValidate
|
class TaskAllocationValidate extends BaseValidate
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置校验规则
|
* 设置校验规则
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require',
|
||||||
];
|
'annex' => 'checkAnnex'
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* 参数描述
|
/**
|
||||||
* @var string[]
|
* 参数描述
|
||||||
*/
|
* @var string[]
|
||||||
protected $field = [
|
*/
|
||||||
'id' => 'id',
|
protected $field = [
|
||||||
];
|
'id' => 'id',
|
||||||
|
|
||||||
|
];
|
||||||
/**
|
|
||||||
* @notes 添加场景
|
|
||||||
* @return TaskAllocationValidate
|
/**
|
||||||
* @author likeadmin
|
* @notes 添加场景
|
||||||
* @date 2024/02/22 10:47
|
* @return TaskAllocationValidate
|
||||||
*/
|
* @author likeadmin
|
||||||
public function sceneAdd()
|
* @date 2024/02/22 10:47
|
||||||
{
|
*/
|
||||||
return $this->remove('id', true);
|
public function sceneAdd()
|
||||||
}
|
{
|
||||||
|
return $this->remove('id', true);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @notes 编辑场景
|
|
||||||
* @return TaskAllocationValidate
|
/**
|
||||||
* @author likeadmin
|
* @notes 编辑场景
|
||||||
* @date 2024/02/22 10:47
|
* @return TaskAllocationValidate
|
||||||
*/
|
* @author likeadmin
|
||||||
public function sceneEdit()
|
* @date 2024/02/22 10:47
|
||||||
{
|
*/
|
||||||
return $this->only(['id']);
|
public function sceneEdit()
|
||||||
}
|
{
|
||||||
|
return $this->only(['id','annex']);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @notes 删除场景
|
|
||||||
* @return TaskAllocationValidate
|
/**
|
||||||
* @author likeadmin
|
* @notes 删除场景
|
||||||
* @date 2024/02/22 10:47
|
* @return TaskAllocationValidate
|
||||||
*/
|
* @author likeadmin
|
||||||
public function sceneDelete()
|
* @date 2024/02/22 10:47
|
||||||
{
|
*/
|
||||||
return $this->only(['id']);
|
public function sceneDelete()
|
||||||
}
|
{
|
||||||
|
return $this->only(['id']);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @notes 详情场景
|
|
||||||
* @return TaskAllocationValidate
|
/**
|
||||||
* @author likeadmin
|
* @notes 详情场景
|
||||||
* @date 2024/02/22 10:47
|
* @return TaskAllocationValidate
|
||||||
*/
|
* @author likeadmin
|
||||||
public function sceneDetail()
|
* @date 2024/02/22 10:47
|
||||||
{
|
*/
|
||||||
return $this->only(['id']);
|
public function sceneDetail()
|
||||||
}
|
{
|
||||||
|
return $this->only(['id']);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user