123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace app\admin\model;
- use think\Model;
- class PalmpaySubAccount extends Model
- {
- // 表名
- protected $table = 'palmpay_sub_account';
-
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = 'int';
- // 定义时间戳字段名
- protected $createTime = 'createtime';
- protected $updateTime = false;
-
- // 追加属性
- protected $append = [
- 'sub_account_type_text'
- ];
-
-
- public function getSubAccountTypeList()
- {
- return ['1' => __('Sub_account_type 1'),'2' => __('Sub_account_type 2')];
- }
- public function getSubAccountTypeTextAttr($value, $data)
- {
- $value = $value ? $value : ($data['sub_account_type']??'');
- $list = $this->getSubAccountTypeList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- }
|