This commit is contained in:
weiz 2024-03-22 16:22:59 +08:00
parent b92811cc8d
commit 85be542474
2 changed files with 150 additions and 139 deletions

View File

@ -12,22 +12,22 @@
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\logic\project; namespace app\adminapi\logic\project;
use app\common\model\project\Project; use app\common\logic\BaseLogic;
use app\common\model\project\ProjectLogs; use app\common\model\project\Project;
use app\common\logic\BaseLogic; use app\common\model\project\ProjectLogs;
use think\facade\Db; use think\facade\Db;
/** /**
* 项目日志管理逻辑 * 项目日志管理逻辑
* Class ProjectLogsLogic * Class ProjectLogsLogic
* @package app\adminapi\logic\project * @package app\adminapi\logic\project
*/ */
class ProjectLogsLogic extends BaseLogic class ProjectLogsLogic extends BaseLogic
{ {
/** /**
@ -118,9 +118,10 @@ class ProjectLogsLogic extends BaseLogic
public static function detail($params): array public static function detail($params): array
{ {
$data = ProjectLogs::findOrEmpty($params['id']); $data = ProjectLogs::findOrEmpty($params['id']);
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty(); $project = Project::field('name,project_code')->where('id', $data['project_id'])->findOrEmpty();
$data['project_name'] = $project['name']; $data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code']; $data['project_code'] = $project['project_code'];
$data['follow_type_text'] = $data->follow_type_text;
return $data->toArray(); return $data->toArray();
} }
} }

View File

@ -12,29 +12,39 @@
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\common\model\project; namespace app\common\model\project;
use app\common\model\BaseModel; use app\common\model\BaseModel;
use think\model\concern\SoftDelete; use app\common\model\dict\DictData;
use think\model\concern\SoftDelete;
/** /**
* 项目日志管理模型 * 项目日志管理模型
* Class ProjectLogs * Class ProjectLogs
* @package app\common\model\project * @package app\common\model\project
*/ */
class ProjectLogs extends BaseModel class ProjectLogs extends BaseModel
{ {
use SoftDelete; use SoftDelete;
protected $name = 'project_logs'; protected $name = 'project_logs';
protected $deleteTime = 'delete_time'; protected $deleteTime = 'delete_time';
public function getNextFollowUpDateAttr($value){ public function getNextFollowUpDateAttr($value)
return !empty($value) ? date('Y-m-d',$value) : ''; {
return !empty($value) ? date('Y-m-d', $value) : '';
} }
public function getDateAttr($value){ public function getFollowTypeTextAttr($value, $data)
return !empty($value) ? date('Y-m-d',$value) : ''; {
$dict = DictData::where('type_value', 'follow_type')->column('name', 'value');
return !empty($data['follow_type']) ? $dict[$data['follow_type']] : '';
}
public function getDateAttr($value)
{
return !empty($value) ? date('Y-m-d', $value) : '';
}
} }
}