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