$projectCode, 'deleted' => 0])->field('id')->find(); if (!$project) { return error(3, '该项目已失效'); } $data = [ 'create_time' => nowTime(), 'code' => createUniqueCode('ProjectInfo'), 'project_code' => $projectCode, 'description' => $description, 'organization_code' => $organizationCode, 'value' => trim($value), 'sort' => $sort, 'name' => trim($name), ]; $result = self::create($data)->toArray(); return $result; } }