mirror of https://gitee.com/karson/fastadmin.git
43 lines
992 B
PHP
43 lines
992 B
PHP
<?php
|
|
|
|
namespace app\common\model;
|
|
|
|
use think\Model;
|
|
|
|
class Live extends Model
|
|
{
|
|
// 表名
|
|
protected $name = 'live';
|
|
|
|
|
|
public function getAdvancedataList()
|
|
{
|
|
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
|
}
|
|
|
|
public function getListList()
|
|
{
|
|
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
|
}
|
|
|
|
|
|
public function getAdvancedataTextAttr($value, $data)
|
|
{
|
|
$value = $value ? $value : $data['advancedata'];
|
|
$list = $this->getAdvancedataList();
|
|
return isset($list[$value]) ? $list[$value] : '';
|
|
}
|
|
|
|
|
|
public function getListTextAttr($value, $data)
|
|
{
|
|
$value = $value ? $value : $data['list'];
|
|
$list = $this->getListList();
|
|
return isset($list[$value]) ? $list[$value] : '';
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|