如下图:
1、动态下拉列表
js文件代码:
{field: ‘source’, title: __(‘用户来源’), searchList: $.getJSON(“member/member/source”)},
php代码:
/**
* 用户来源
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function source(){
$json = cache('source');
if ($json===false){
$list = Db::name('source')->select();
$json = json($list);
cache('source',$json);
}
return $json;
}
2下拉列表【是或否】
js文件代码:
{field: ‘exam_status’, title: ‘通过考试’,
searchList: {“1”: __(‘Yes’), “0”: __(‘No’)},
formatter:Table.api.formatter.toggle},