engineering/app/common/model/bid/BidBiddingDecision.php
2024-01-27 17:21:24 +08:00

83 lines
2.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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\bid;
use app\common\model\BaseModel;
use app\common\model\dict\DictData;
use think\model\concern\SoftDelete;
/**
* 投标决策模型
* Class BidBiddingDecision
* @package app\common\model\bid
*/
class BidBiddingDecision extends BaseModel
{
use SoftDelete;
protected $name = 'bid_bidding_decision';
protected $deleteTime = 'delete_time';
public function getBiddingTimeAttr($value): string
{
return empty($value) ? '' : date('Y-m-d', $value);
}
public function getBidOpeningDateAttr($value): string
{
return empty($value) ? '' : date('Y-m-d', $value);
}
public function getMarginAmountReturnDateAttr($value): string
{
return empty($value) ? '' : date('Y-m-d', $value);
}
public function getBiddingProjectFundSourceTextAttr($value,$data){
$dictData = DictData::where('type_value','construction_funds_sources')->column('name','value');
$dictData[0] ='';
return $dictData[$data['bidding_project_fund_source']];
}
public function getBidTypeTextAttr($value,$data){
$dictData = DictData::where('type_value','bidding_method')->column('name','value');
$dictData[0] ='';
return $dictData[$data['bid_type']];
}
public function getProjectAssuranceTextAttr($value,$data){
$dictData = DictData::where('type_value','project_assurance')->column('name','value');
return !empty($data['project_assurance']) ? $dictData[$data['project_assurance']] : '';
}
public function getIsMarginTextAttr($value,$data): string
{
$is_margin = [0=>'', 1=>'是',2=>'否'];
return $is_margin[$data['is_margin']];
}
public function getIsInternalResourcesTextAttr($value,$data): string
{
$is_internal_resources = [0=>'',1=>'有','2'=>'无'];
return $is_internal_resources[$data['is_internal_resources']];
}
public function getAnnexAttr($value)
{
return !empty($value) ? json_decode($value,true) : '';
}
}