对于一些不想在列表中展示的字段,增加过滤入口

pull/406/head
mengkang.zmk 2022-05-29 17:26:04 +08:00
parent 3fd25c3de0
commit d97c80ce8f
2 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,7 @@ trait Backend
$list = $this->model
->where($where)
->order($sort, $order)
->field($this->listDisplayFields)
->paginate($limit);
$result = ['total' => $list->total(), 'rows' => $list->items()];
return json($result);

View File

@ -92,6 +92,12 @@ class Backend extends Controller
*/
protected $multiFields = 'status';
/**
* 列表默认显示字段
* @var array|string
*/
protected $listDisplayFields = '*';
/**
* Selectpage可显示的字段
*/