123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?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 = [
- 'no_screenshot' => config('site.no_screenshot'), //禁止截图
- 'show_wechat_pay' => config('site.show_wechat_pay'), //是否显示微信支付
- 'show_ali_pay' => config('site.show_ali_pay'), //是否显示支付宝支付
- 'show_intimacy' => config('site.show_intimacy'), //是否显示亲密度等级差
- ];
- $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,['images','video_file']);
- $this->success('success',$info);
- }
- //个人资料的一下枚举
- public function userinfo_enum(){
- $enum_hobby_type = Db::name('enum_hobby_type')->field('id,name')->order('weight desc,id desc')->select();
- $mt_enum_hobby = Db::name('enum_hobby');
- foreach ($enum_hobby_type as &$v) {
- $v['list'] = $mt_enum_hobby->where(['type_id' => $v['id']])->field('id,name')->order('weight desc,id desc')->select();
- }
- // $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();
- $enum_character = Db::name('enum_character')->field('id,name')->order('weight desc,id desc')->select();
- $enum_constellation = Db::name('enum_constellation')->field('id,name')->order('weight desc,id desc')->select();
- $enum_stature = Db::name('enum_stature')->field('id,name')->order('weight desc,id desc')->select();
- $enum_live = Db::name('enum_live')->field('id,name')->order('weight desc,id desc')->select();
- $enum_car = Db::name('enum_car')->field('id,name')->order('weight desc,id desc')->select();
- $enum_chest = Db::name('enum_chest')->field('id,name')->order('weight desc,id desc')->select();
- $data = [
- 'enum_hobby' => $enum_hobby_type,
- 'enum_job' => $enum_job,
- 'enum_marital' => $enum_marital,
- 'enum_education' => $enum_education,
- 'enum_tag' => $enum_tag,
- 'enum_wages' => $enum_wages,
- 'enum_character' => $enum_character,
- 'enum_constellation' => $enum_constellation,
- 'enum_stature' => $enum_stature,
- 'enum_live' => $enum_live,
- 'enum_car' => $enum_car,
- 'enum_chest' => $enum_chest,
- ];
- $this->success('success',$data);
- }
- //关键字过滤
- public function keyworld_config(){
- $config = config('keyworld');
- $this->success('success',$config);
- }
- //获取版本更新信息
- public function getversion() {
- // 获取二维码
- $is_force = config("site.is_force"); //是否强制更新 1是 0否
- $apk_url = config("site.apk_url"); //下载链接
- $apk_name = config("site.apk_name"); //apk更新标题
- $apk_desc = config("site.apk_desc"); //apk更新描述
- $version_code = config("site.version_code"); //版本迭代号
- $update_version = config("site.android_update_version"); //安卓更新展示版本
- $data['is_force'] = $is_force;
- $data['apk_url'] = $apk_url;
- $data['apk_name'] = $apk_name;
- $data['apk_desc'] = $apk_desc;
- $data['version_code'] = $version_code;
- $data['update_version'] = $update_version;
- $this->success('Success', $data);
- }
- //获取ios版本更新信息
- public function getiosversion() {
- // 获取二维码
- $is_force = config("site.ios_is_force"); //是否强制更新 1是 0否
- $apk_url = config("site.ios_apk_url"); //下载链接
- $apk_name = config("site.ios_apk_name"); //apk更新标题
- $apk_desc = config("site.ios_apk_desc"); //apk更新描述
- $version_code = config("site.ios_version_code"); //版本迭代号
- $update_version = config("site.ios_update_version"); //ios更新展示版本
- $data['is_force'] = $is_force;
- $data['apk_url'] = $apk_url;
- $data['apk_name'] = $apk_name;
- $data['apk_desc'] = $apk_desc;
- $data['version_code'] = $version_code;
- $data['update_version'] = $update_version;
- $this->success('Success', $data);
- }
- }
|