This commit is contained in:
weiz 2024-03-19 11:54:22 +08:00
parent 43f817c657
commit 17d94a5ecd
2 changed files with 12 additions and 3 deletions

View File

@ -15,6 +15,7 @@
namespace app\adminapi\logic\task;
use app\common\model\cost_project\CostProject;
use app\common\model\task\TaskType;
use app\common\logic\BaseLogic;
use app\common\model\TaskDetail;
@ -119,6 +120,10 @@ class TaskTypeLogic extends BaseLogic
*/
public static function detail($params): array
{
return TaskType::findOrEmpty($params['id'])->toArray();
$data = TaskType::findOrEmpty($params['id']);
$project = CostProject::field('project_name')->where('id',$data['cost_project_id'])->findOrEmpty();
$data['project_name'] = $project['project_name'];
$data['superior_sort_text'] = $data->superior_sort_text;
return $data->toArray();
}
}

View File

@ -16,6 +16,7 @@ namespace app\common\model\task;
use app\common\model\BaseModel;
use app\common\model\dict\DictData;
use think\model\concern\SoftDelete;
@ -29,6 +30,9 @@ class TaskType extends BaseModel
use SoftDelete;
protected $name = 'task_type';
protected $deleteTime = 'delete_time';
public function getSuperiorSortTextAttr($value,$data){
$dict = DictData::where('type_value','superior_category')->column('name','value');
return !empty($data['superior_sort']) ? $dict[$data['superior_sort']] : '';
}
}