12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace app\admin\model;
- use think\Model;
- class Company extends Model
- {
-
-
- // 表名
- protected $name = 'company';
-
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = false;
- // 定义时间戳字段名
- protected $createTime = false;
- protected $updateTime = false;
- protected $deleteTime = false;
- // 追加属性
- protected $append = [
- 'wechat_encode_text',
- 'pay_weixin_open_text',
- 'pay_routine_open_text',
- 'wx_open_platform_text'
- ];
-
-
- public function getWechatEncodeList()
- {
- return ['0' => __('Wechat_encode 0'), '1' => __('Wechat_encode 1'), '2' => __('Wechat_encode 2')];
- }
- public function getPayWeixinOpenList()
- {
- return ['0' => __('Pay_weixin_open 0'), '1' => __('Pay_weixin_open 1')];
- }
- public function getPayRoutineOpenList()
- {
- return ['0' => __('Pay_routine_open 0'), '1' => __('Pay_routine_open 1')];
- }
- public function getWxOpenPlatformList()
- {
- return ['0' => __('Wx_open_platform 0'), '1' => __('Wx_open_platform 1')];
- }
- public function getWechatEncodeTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['wechat_encode']) ? $data['wechat_encode'] : '');
- $list = $this->getWechatEncodeList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- public function getPayWeixinOpenTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['pay_weixin_open']) ? $data['pay_weixin_open'] : '');
- $list = $this->getPayWeixinOpenList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- public function getPayRoutineOpenTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['pay_routine_open']) ? $data['pay_routine_open'] : '');
- $list = $this->getPayRoutineOpenList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- public function getWxOpenPlatformTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['wx_open_platform']) ? $data['wx_open_platform'] : '');
- $list = $this->getWxOpenPlatformList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- }
|