update
This commit is contained in:
parent
85be542474
commit
6a3fc45e04
@ -15,8 +15,8 @@
|
||||
namespace app\adminapi\logic\project;
|
||||
|
||||
|
||||
use app\common\model\project\ProjectCostTempSet;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\project\ProjectCostTempSet;
|
||||
use app\common\model\project\ProjectTypeSet;
|
||||
use think\facade\Db;
|
||||
|
||||
@ -112,9 +112,10 @@ class ProjectCostTempSetLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectCostTempSet::field('id,project_type_id,subject_code,first_level_subject,second_level_subject,third_level_subject,unit,is_travel')->findOrEmpty($params['id'])->toArray();
|
||||
$data = ProjectCostTempSet::field('id,project_type_id,subject_code,first_level_subject,second_level_subject,third_level_subject,unit,is_travel')->findOrEmpty($params['id']);
|
||||
$projectType = ProjectTypeSet::field('name')->where('id', $data['project_type_id'])->findOrEmpty();
|
||||
$data['project_type_name'] = $projectType['name'];
|
||||
return $data;
|
||||
$data['is_travel_text'] = $data->is_travel_text;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -15,8 +15,8 @@
|
||||
namespace app\adminapi\logic\project;
|
||||
|
||||
|
||||
use app\common\model\project\ProjectDocumentSet;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\project\ProjectDocumentSet;
|
||||
use app\common\model\project\ProjectTypeSet;
|
||||
use think\facade\Db;
|
||||
|
||||
@ -114,9 +114,10 @@ class ProjectDocumentSetLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectDocumentSet::field('id,project_type_id,large_category,middle_category,small_category,name,describe,is_upload,sort')->findOrEmpty($params['id'])->toArray();
|
||||
$data = ProjectDocumentSet::field('id,project_type_id,large_category,middle_category,small_category,name,describe,is_upload,sort')->findOrEmpty($params['id']);
|
||||
$projectType = ProjectTypeSet::field('name')->where('id', $data['project_type_id'])->findOrEmpty();
|
||||
$data['project_type_name'] = $projectType['name'];
|
||||
return $data;
|
||||
$data['is_upload_text'] = $data->is_upload_text;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -18,7 +18,6 @@ namespace app\common\model\project;
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 项目费用模板模型
|
||||
* Class ProjectCostTempSet
|
||||
@ -33,6 +32,6 @@ class ProjectCostTempSet extends BaseModel
|
||||
public function getIsTravelTextAttr($value, $data): string
|
||||
{
|
||||
$arr = [1 => '是', 2 => '否'];
|
||||
return $arr[$data['is_travel']];
|
||||
return !empty($data['is_travel']) ? $arr[$data['is_travel']] : '';
|
||||
}
|
||||
}
|
@ -27,8 +27,13 @@ use think\model\concern\SoftDelete;
|
||||
class ProjectDocumentSet extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $name = 'project_document_set';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
public function getIsUploadTextAttr($value, $data): string
|
||||
{
|
||||
$arr = [1 => '是', 2 => '否'];
|
||||
return !empty($data['is_upload']) ? $arr[$data['is_upload']] : '';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user