<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Db;
/**
 * 基础配置接口
 */
class Baseconfig extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

   
    public function index(){

        $config = [
            'domain_name' => config('site.domain_name'),
            'domain_cdnurl' => config('site.domain_cdnurl'),
            'android_update_num' => config('site.android_update_num'),
            'android_update_version' => config('site.android_update_version'),
            'ios_update_num' => config('site.ios_update_num'),
            'ios_update_version' => config('site.ios_update_version'),
            'livebc_type' => Db::name('party_type')->where('room_type',2)->order('id asc')->select(),
            'taluopai' => config('site.taluopai'),
        ];

        $this->success('success',$config);
    }

    //启动广告图
    public function start_advert(){
        $info = Db::name('start_advert')->where('is_show',1)->order('id desc')->find();
        $info = info_domain_image($info,['image']);
        $this->success('success',$info);
    }

    //个人资料的一下枚举
    public function userinfo_enum(){
        $enum_hobby = Db::name('enum_hobby')->field('id,name')->order('weight desc,id desc')->select();
        $enum_job = Db::name('enum_job')->field('id,name')->order('weight desc,id desc')->select();
        $enum_marital = Db::name('enum_marital')->field('id,name')->order('weight desc,id desc')->select();
        $enum_education = Db::name('enum_education')->field('id,name')->order('weight desc,id desc')->select();
        $enum_tag = Db::name('enum_tag')->field('id,name')->order('weight desc,id desc')->select();
        $enum_wages = Db::name('enum_wages')->field('id,name')->order('weight desc,id desc')->select();

        $data = [
            'enum_hobby' => $enum_hobby,
            'enum_job' => $enum_job,
            'enum_marital' => $enum_marital,
            'enum_education' => $enum_education,
            'enum_tag' => $enum_tag,
            'enum_wages' => $enum_wages,
        ];

        $this->success('success',$data);
    }

}
