engineering/app/common/model/marketing/MarketingContract.php
2024-04-03 16:27:45 +08:00

127 lines
4.2 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\marketing;
use app\common\model\BaseModel;
use app\common\model\dict\DictData;
use think\model\concern\SoftDelete;
/**
* 市场经营--合同信息模型
* Class MarketingContract
* @package app\common\model\marketing
*/
class MarketingContract extends BaseModel
{
use SoftDelete;
protected $name = 'marketing_contract';
protected $deleteTime = 'delete_time';
public function getContractTypeTextAttr($value, $data): string
{
$arr = [0 => '主合同', 1 => '框架协议', 2 => '补充协议'];
return $arr[$data['contract_type']];
}
public function getBusinessNatureTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'cost_consultation_business_nature')->column('name', 'value');
return !empty($data['business_nature']) ? $dict[$data['business_nature']] : '';
}
public function getIndustryNatureTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'cost_consultation_industry_nature')->column('name', 'value');
return !empty($data['industry_nature']) ? $dict[$data['industry_nature']] : '';
}
public function getFundSourcesTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'cost_consultation_fund_sources')->column('name', 'value');
return !empty($data['fund_sources']) ? $dict[$data['fund_sources']] : '';
}
public function getConstAreaTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'cost_consultation_const_area')->column('name', 'value');
return !empty($data['const_area']) ? $dict[$data['const_area']] : '';
}
public function getAgreementNatureTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'agreement_nature')->column('name', 'value');
return !empty($data['agreement_nature']) ? $dict[$data['agreement_nature']] : '';
}
public function getImplementMethodTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'cost_consultation_way')->column('name', 'value');
return !empty($data['implement_method']) ? $dict[$data['implement_method']] : '';
}
public function getFileTypeTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'cost_consultation_file_type')->column('name', 'value');
return !empty($data['file_type']) ? $dict[$data['file_type']] : '';
}
public function getSealNameTextAttr($value, $data)
{
$dict = DictData::where('type_value', 'cost_consultation_seal_name')->column('name', 'value');
return !empty($data['seal_name']) ? $dict[$data['seal_name']] : '';
}
public function getIsLimitTextAttr($value, $data): string
{
$arr = [0 => '否', 1 => '是'];
return $arr[$data['is_limit']];
}
public function getPlanceSealTextAttr($value, $data): string
{
$arr = [0 => '否', 1 => '是'];
return $arr[$data['plance_seal']];
}
public function getReviewStatusTextAttr($value, $data): string
{
$arr = [0 => '待移交', 1 => '已移交'];
return $arr[$data['review_status']];
}
public function getStartDateAttr($value): string
{
return !empty($value) ? date('Y-m-d', $value) : '';
}
public function getEndDateAttr($value): string
{
return !empty($value) ? date('Y-m-d', $value) : '';
}
public function getPerformanceMoneyExpirationTimeAttr($value): string
{
return !empty($value) ? date('Y-m-d', $value) : '';
}
public function getSendDateAttr($value): string
{
return !empty($value) ? date('Y-m-d', $value) : '';
}
}