132 lines
4.3 KiB
PHP
132 lines
4.3 KiB
PHP
<?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\common\model\manage_basic;
|
||
|
||
use app\common\model\auth\Admin;
|
||
use app\common\model\BaseModel;
|
||
use app\common\model\dept\Dept;
|
||
use app\common\model\dict\DictData;
|
||
use app\common\model\marketing\MarketingContract;
|
||
use app\common\model\marketing\MarketingCustom;
|
||
use think\model\concern\SoftDelete;
|
||
|
||
|
||
/**
|
||
* 项目管理--项目信息模型
|
||
* Class ManageProject
|
||
* @package app\common\model\manage_basic
|
||
*/
|
||
class ManageProject extends BaseModel
|
||
{
|
||
use SoftDelete;
|
||
protected $name = 'manage_project';
|
||
protected $deleteTime = 'delete_time';
|
||
|
||
public function getIndustryTextAttr($value,$data){
|
||
$dict = DictData::where('type_value','supervision_project_industry')->column('name','value');
|
||
return !empty($data['industry']) ? $dict[$data['industry']] : '';
|
||
}
|
||
|
||
public function getNatureTextAttr($value,$data){
|
||
$dict = DictData::where('type_value','supervision_project_nature')->column('name','value');
|
||
return !empty($data['nature']) ? $dict[$data['nature']] : '';
|
||
}
|
||
|
||
public function getBuildAreaTextAttr($value,$data){
|
||
$dict = DictData::where('type_value','supervision_project_build_area')->column('name','value');
|
||
return !empty($data['build_area']) ? $dict[$data['build_area']] : '';
|
||
}
|
||
|
||
public function getProjectLevelTextAttr($value,$data){
|
||
$dict = DictData::where('type_value','supervision_project_level')->column('name','value');
|
||
return !empty($data['project_level']) ? $dict[$data['project_level']] : '';
|
||
}
|
||
|
||
public function getEngineeringStatusTextAttr($value,$data){
|
||
$dict = DictData::where('type_value','supervision_project_status')->column('name','value');
|
||
return !empty($data['engineering_status']) ? $dict[$data['engineering_status']] : '';
|
||
}
|
||
public function getBuildUnitNameTextAttr($value,$data){
|
||
if($data['build_unit']>0){
|
||
return MarketingCustom::where('id',$data['build_unit'])->value('name');
|
||
}else{
|
||
return 0;
|
||
}
|
||
}
|
||
public function getContractNameTextAttr($value,$data){
|
||
if($data['contract']>0){
|
||
return MarketingContract::where('id',$data['contract'])->value('contract_name');
|
||
}else{
|
||
return 0;
|
||
}
|
||
}
|
||
public function getProjectManagerNameTextAttr($value,$data){
|
||
if($data['project_manager']>0){
|
||
return Admin::where('id',$data['project_manager'])->value('name');
|
||
}
|
||
return 0;
|
||
}
|
||
public function getProjectLeaderNameTextAttr($value,$data){
|
||
if($data['project_manager']>0){
|
||
return Admin::where('id',$data['project_manager'])->value('name');
|
||
}
|
||
return 0;
|
||
}
|
||
public function getSupervisionDepartmentNameTextAttr($value,$data){
|
||
if($data['supervision_department']>0){
|
||
return Dept::where('id',$data['supervision_department'])->value('name');
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
public function getImplementationDepartmentNameTextAttr($value,$data){
|
||
if($data['implementation_department']>0){
|
||
return Dept::where('id',$data['implementation_department'])->value('name');
|
||
}
|
||
return 0;
|
||
}
|
||
public function getProjectDepartmentNameTextAttr($value,$data){
|
||
if($data['project_department']>0){
|
||
return Dept::where('id',$data['project_department'])->value('name');
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
public function getActualStartDateAttr($value): string
|
||
{
|
||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||
}
|
||
|
||
public function getActualEndDateAttr($value): string
|
||
{
|
||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||
}
|
||
|
||
public function getPlannedStartDateAttr($value): string
|
||
{
|
||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||
}
|
||
|
||
public function getPlannedEndDateAttr($value): string
|
||
{
|
||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||
}
|
||
|
||
public function getInitiationDateAttr($value): string
|
||
{
|
||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||
}
|
||
|
||
} |