123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- namespace app\admin\model\cms\author;
- use think\Model;
- class Manuscript extends Model
- {
-
-
- // 表名
- protected $name = 'cms_author_manuscript';
-
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = 'integer';
- // 定义时间戳字段名
- protected $createTime = 'createtime';
- protected $updateTime = 'updatetime';
- protected $deleteTime = false;
- // 追加属性
- protected $append = [
- 'is_copyright_text',
- 'is_funding_text',
- 'is_interest_text',
- 'statement_type_text',
- 'status_text'
- ];
-
-
- public function getIsCopyrightList()
- {
- return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
- }
- public function getIsFundingList()
- {
- return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
- }
- public function getIsInterestList()
- {
- return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
- }
- public function getStatementTypeList()
- {
- return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
- }
- public function getStatusList()
- {
- return ['100' => __('Status 100')];
- }
- public function getIsCopyrightTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['is_copyright']) ? $data['is_copyright'] : '');
- $list = $this->getIsCopyrightList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- public function getIsFundingTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['is_funding']) ? $data['is_funding'] : '');
- $list = $this->getIsFundingList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- public function getIsInterestTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['is_interest']) ? $data['is_interest'] : '');
- $list = $this->getIsInterestList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- public function getStatementTypeTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['statement_type']) ? $data['statement_type'] : '');
- $list = $this->getStatementTypeList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- public function getStatusTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
- $list = $this->getStatusList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- }
|