save
This commit is contained in:
parent
5f7ede6b28
commit
a34ad835ab
@ -12,7 +12,7 @@ use support\Response;
|
|||||||
*/
|
*/
|
||||||
class AdminController extends Crud
|
class AdminController extends Crud
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Admin
|
* @var Admin
|
||||||
*/
|
*/
|
||||||
@ -84,4 +84,21 @@ class AdminController extends Crud
|
|||||||
return $this->json(0);
|
return $this->json(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化下拉列表
|
||||||
|
* @param $items
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
protected function formatSelect($items): Response
|
||||||
|
{
|
||||||
|
$formatted_items = [];
|
||||||
|
foreach ($items as $item) {
|
||||||
|
$formatted_items[] = [
|
||||||
|
'name' => $item->nickname,
|
||||||
|
'value' => $item->id
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return $this->json(0, 'ok', $formatted_items);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user