<?php

namespace app\admin\controller;

use app\admin\AdminBaseController;
use app\common\model\SettingModel;

class Talent extends AdminBaseController
{

    /**
     * 列表
     */
    public function index()
    {
        $system = SettingModel::getConfigValue(SettingModel::TALENT);
        return view('', [
            'system' => $system,
        ]);
    }

    public function editTalent()
    {
        $data = $this->_post(SettingModel::TALENT);
        SettingModel::setConfigValue($data);
        ajax_return();
    }

    /**
     * 获取数据
     * @param array $param 要获取的数据
     * @return array
     */
    public function _post(array $param)
    {
        $res = [];
        foreach ($param as $v) {
            if (input($v) === '0' || !empty(input($v))) {
                $res[$v] = input($v);
            }
        }

        return $res;
    }
}