tapi/app/controller/admin/system/ConfigController.php
u2nyakim 31b8e5807f up.
2025-08-22 13:45:32 +08:00

30 lines
713 B
PHP

<?php
namespace app\controller\admin\system;
use app\BaseController;
use app\entity\SysConfig;
use app\service\CurdService;
use think\response\Json;
class ConfigController extends BaseController
{
public function list(): Json
{
$model = SysConfig::with([])
->withSearch(['group'], [
'group'=> $this->request->get('group/s','')
]);
$paginate = CurdService::getPaginate($this->request, $model);
return $this->writeSuccess('success', $paginate);
}
public function data(string $name)
{
$config = SysConfig::where('name', $name)->findOrEmpty();
return $this->writeSuccess('success', $config->toArray());
}
}