123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use think\Db;
- use Redis;
- /**
- * 基础配置接口
- */
- class Baseconfig extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
- public function apiurl(){
- // $this->success('success','https://jiankangyijia.huxiukeji.cn');
- }
-
- public function index(){
- $config = [
- 'kefu_phone' => config('site.kefuphoneno'),//客服电话号
- 'kefu_email' => config('site.kefuemail'),//客服邮箱
- 'index_jiuyipeizhen' => localpath_to_netpath(config('site.index_jiuyipeizhen')),//首页就医陪诊
- 'index_hulipeihu' => localpath_to_netpath(config('site.index_hulipeihu')),//首页护理陪护
- 'app_imgroup_switch' => config('site.app_imgroup_switch'),//APP群聊功能开关
- ];
- $this->success('success',$config);
- }
- //用户端版本
- public function user_app_version(){
- $config = [
- 'android_update_num' => config('site.user_android_update_num'), //android版本迭代号
- 'android_update_version' => config('site.user_android_update_version'), //android展示版本号
- 'android_download_url' => config('site.user_android_download_url'), //android下载链接
- 'android_update_force' => config('site.user_android_update_force'), //android是否强制更新
- 'android_update_title' => config('site.user_android_update_title'), //android更新标题
- 'android_update_info' => config('site.user_android_update_info'), //android更新描述
- 'ios_update_num' => config('site.user_ios_update_num'), //ios版本迭代号
- 'ios_update_version' => config('site.user_ios_update_version'), //ios展示版本号
- 'ios_download_url' => config('site.user_ios_download_url'), //ios下载链接
- 'ios_update_force' => config('site.user_ios_update_force'), //ios是否强制更新
- 'ios_update_title' => config('site.user_ios_update_title'), //ios更新标题
- 'ios_update_info' => config('site.user_ios_update_info'), //ios更新描述
- ];
- $this->success('success',$config);
- }
- //医生端版本
- public function doctor_app_version(){
- $config = [
- 'android_update_num' => config('site.doctor_android_update_num'), //android版本迭代号
- 'android_update_version' => config('site.doctor_android_update_version'), //android展示版本号
- 'android_download_url' => config('site.doctor_android_download_url'), //android下载链接
- 'android_update_force' => config('site.doctor_android_update_force'), //android是否强制更新
- 'android_update_title' => config('site.doctor_android_update_title'), //android更新标题
- 'android_update_info' => config('site.doctor_android_update_info'), //android更新描述
- 'ios_update_num' => config('site.doctor_ios_update_num'), //ios版本迭代号
- 'ios_update_version' => config('site.doctor_ios_update_version'), //ios展示版本号
- 'ios_download_url' => config('site.doctor_ios_download_url'), //ios下载链接
- 'ios_update_force' => config('site.doctor_ios_update_force'), //ios是否强制更新
- 'ios_update_title' => config('site.doctor_ios_update_title'), //ios更新标题
- 'ios_update_info' => config('site.doctor_ios_update_info'), //ios更新描述
- ];
- $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 = 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,color')->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,
- 'enumtag_max' => config('site.enumtag_max'),//最多可选个数
- // 'enum_wages' => $enum_wages,
- ];
- $this->success('success',$data);
- }
- //关键字过滤
- public function keyworld_config(){
- $config = config('keyworld');
- $this->success('success',$config);
- }
- public function keyworld_config_redis(){
- //redis
- $redis = new Redis();
- $redisconfig = config("redis");
- $redis->connect($redisconfig["host"], $redisconfig["port"]);
- if ($redisconfig['redis_pwd']) {
- $redis->auth($redisconfig['redis_pwd']);
- }
- if($redisconfig['redis_selectdb'] > 0){
- $redis->select($redisconfig['redis_selectdb']);
- }
- $redis_key = 'keyworld';
- $cache_data = $redis->get($redis_key);
- if($cache_data){
- $cache_data = json_decode($cache_data,true);
- $this->success('success',$cache_data);
- }else{
- $cache_data = config('keyworld');
- $redis->set($redis_key,json_encode($cache_data));
- $this->success('success',$cache_data);
- }
- }
- ///////////////////////本项目用不到的//////////////////////////////
- /**
- * 获取安卓版本更新信息
- */
- public function getandroidEdition() {
- // 获取二维码
- $is_force = config("site.android_is_force");
- $apkUrl = config("site.android_apkUrl");
- $apkName = config("site.android_apkName");
- $desc = config("site.android_desc");
- $versionCode = config("site.android_versionCode");
- $this->success("获取成功!",["versionCode"=>$versionCode,"isForceUpdate"=>$is_force,"apkUrl"=>$apkUrl,"apkName"=>$apkName,"desc"=>$desc]);
- }
- /**
- * 获取ios版本更新信息
- */
- public function getiosEdition() {
- // 获取二维码
- $is_force = config("site.iso_is_force");
- $apkUrl = config("site.ios_downurl");
- $apkName = config("site.iso_appname");
- $desc = config("site.iso_desc");
- $versionCode = config("site.iso_versioncode");
- $this->success("获取成功!",["versionCode"=>$versionCode,"isForceUpdate"=>$is_force,"apkUrl"=>$apkUrl,"apkName"=>$apkName,"desc"=>$desc]);
- }
- }
|