推流拉流model

pull/57/head
xingchao 2018-04-16 08:45:07 +08:00
parent 4cf807f996
commit a9680c36bb
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<?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] : '';
}
}