<?php

namespace App\Http\Controllers\API\Admin;

use App\Http\Controllers\Controller;
use App\Services\ConfigService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class ConfigController extends Controller
{

    //获取站点配置信息
    public function GetConfigInfo(){
        $configs = new ConfigService();
        $config_arrs = request('config_arrs');
        if(!isset($config_arrs) || empty($config_arrs)){
            $config_arrs =['站点名称','站点图片','门诊缴费超时时间','门诊缴费轮询间隔'];
        }
        return $configs->GetConfigInfo($config_arrs);
    }
    public function GetConfigInfo2(){
        $config_arrs = request('config_arrs');
        $q=DB::table('configs')->select(['label','value'])->whereIn('label',$config_arrs)->get();
        return \Yz::JsonReturn(true,"查询完成",['list'=>$q]);

    }
    public function SaveConfig(){
        $info = request('info');
        $configs = new ConfigService();
        return $configs->SaveConfig($info);
    }
}
