129 lines
4.1 KiB
PHP
129 lines
4.1 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\project;
|
||
|
||
|
||
use app\common\model\BaseModel;
|
||
use app\common\model\dict\DictData;
|
||
use think\model\concern\SoftDelete;
|
||
|
||
|
||
/**
|
||
* Project模型
|
||
* Class Project
|
||
* @package app\common\model\project
|
||
*/
|
||
class Project extends BaseModel
|
||
{
|
||
use SoftDelete;
|
||
protected $name = 'project';
|
||
protected $deleteTime = 'delete_time';
|
||
|
||
public function getStatusTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','project_status')->column('name','value');
|
||
return $dictData[$data['status']];
|
||
}
|
||
|
||
public function getProjectContentTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','project_content')->whereIn('value',$data['project_content'])->column('name');
|
||
return $data['project_content'] ? implode(',',$dictData) : '';
|
||
}
|
||
|
||
public function getBiddingMethodTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','bidding_method')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['bidding_method']];
|
||
}
|
||
|
||
public function getRelationshipTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','relationship')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['relationship']];
|
||
}
|
||
|
||
public function getInformationSourcesTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','information_sources')->column('name','value');
|
||
return empty($data['information_sources']) ? '' : $dictData[$data['information_sources']];
|
||
}
|
||
|
||
public function getConstructionFundsSourcesTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','construction_funds_sources')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['construction_funds_sources']];
|
||
}
|
||
|
||
public function getConstructionFinancialStatusTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','construction_financial_status')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['construction_financial_status']];
|
||
}
|
||
|
||
public function getConstructionRecognitionTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','construction_recognition')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['construction_recognition']];
|
||
}
|
||
|
||
public function getMyConstructionRecognitionTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','my_construction_recognition')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['my_construction_recognition']];
|
||
}
|
||
|
||
public function getStrategicSignificanceTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','strategic_significance')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['strategic_significance']];
|
||
}
|
||
|
||
public function getIndustryTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','industry')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['industry']];
|
||
}
|
||
|
||
public function getUnitNatureTextAttr($value,$data)
|
||
{
|
||
$dictData = DictData::where('type_value','unit_nature')->column('name','value');
|
||
$dictData[0] ='';
|
||
return $dictData[$data['unit_nature']];
|
||
}
|
||
|
||
public function getBiddingTimeAttr($value): string
|
||
{
|
||
return empty($value) ? '' : date('Y-m-d', $value);
|
||
}
|
||
|
||
public function getDiscoveryTimeAttr($value): string
|
||
{
|
||
return empty($value) ? '' : date('Y-m-d', $value);
|
||
}
|
||
|
||
public function getAnnexAttr($value)
|
||
{
|
||
return !empty($value) ? json_decode($value,true) : '';
|
||
}
|
||
} |