JS代码:
{field: 'type.name', title: __('Type.name'), searchList: $.getJSON("ai/activity_type/source")},
PHP代码:
public function source() { $json = cache('ai_activity_type'); if ($json === false) { $typeModel = new \app\admin\model\ai\ActivityType(); $list = $typeModel->field('name')->select(); $json = json($list); cache('ai_activity_type', $json); } return $json; }