123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use think\Db;
- use getusersig\getusersig;
- /**
- * 基础配置接口
- */
- class Baseconfig extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
-
- public function index(){
- $config = [
- 'nowtime' => time(),
- 'nowdate' => date('Y-m-d H:i:s'),
- 'nowdate1' => date('Y-m-d H:i:s',time()+3600),
- 'nowdate2' => '2024-08-20 09:55:23',
- 'nowdate3' => '2024-08-20 19:55:23',
- ];
- $this->success('success',$config);
- }
- //给小程序端用的usersig
- //user_用户端小程序,master_师傅,kefu_客服
- public function tenim_usersig(){
- $user_id = "user_".$this->auth->id;
- // 获取配置信息
- $config = config("tencent_im");
- $usersigObj = new getusersig($config["sdkappid"],$config["key"]);
- $usersig = $usersigObj->genUserSig($user_id);
- $rs = [
- 'usersig' => $usersig,
- 'sdkappid' => $config['sdkappid'],
- ];
- $this->success(1,$rs);
- }
- /**
- * 获取安卓版本更新信息
- */
- 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]);
- }
- //启动广告图
- 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_find('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_suqiu = Db::name('enum_suqiu')->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_suqiu' => $enum_suqiu,
- 'enum_tag' => $enum_tag,
- 'enum_wages' => $enum_wages,
- ];
- $this->success('success',$data);
- }
- //关键字过滤
- public function keyworld_config(){
- $config = config('keyworld');
- $this->success('success',$config);
- }
- }
|