Baseconfig.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 基础配置接口
  7. */
  8. class Baseconfig extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. public function index(){
  13. $config = [
  14. 'kefu_user_ids' => config('site.kefu_user_ids'),//在线客服人员
  15. ];
  16. $this->success('success',$config);
  17. }
  18. /**
  19. * 获取安卓版本更新信息
  20. */
  21. public function getandroidEdition() {
  22. // 获取二维码
  23. $is_force = config("site.android_is_force");
  24. $apkUrl = config("site.android_apkUrl");
  25. $apkName = config("site.android_apkName");
  26. $desc = config("site.android_desc");
  27. $versionCode = config("site.android_versionCode");
  28. $this->success("获取成功!",["versionCode"=>$versionCode,"isForceUpdate"=>$is_force,"apkUrl"=>$apkUrl,"apkName"=>$apkName,"desc"=>$desc]);
  29. }
  30. /**
  31. * 获取ios版本更新信息
  32. */
  33. public function getiosEdition() {
  34. // 获取二维码
  35. $is_force = config("site.iso_is_force");
  36. $apkUrl = config("site.ios_downurl");
  37. $apkName = config("site.iso_appname");
  38. $desc = config("site.iso_desc");
  39. $versionCode = config("site.iso_versioncode");
  40. $this->success("获取成功!",["versionCode"=>$versionCode,"isForceUpdate"=>$is_force,"apkUrl"=>$apkUrl,"apkName"=>$apkName,"desc"=>$desc]);
  41. }
  42. //启动广告图
  43. public function start_advert(){
  44. $info = Db::name('start_advert')->where('is_show',1)->order('id desc')->find();
  45. $info = info_domain_image($info,['images','video_file']);
  46. $this->success_find('success',$info);
  47. }
  48. //个人资料的一下枚举
  49. public function userinfo_enum(){
  50. $enum_hobby = Db::name('enum_hobby')->field('id,name')->order('weight desc,id desc')->select();
  51. $enum_job = Db::name('enum_job')->field('id,name')->order('weight desc,id desc')->select();
  52. $enum_marital = Db::name('enum_marital')->field('id,name')->order('weight desc,id desc')->select();
  53. $enum_suqiu = Db::name('enum_suqiu')->field('id,name')->order('weight desc,id desc')->select();
  54. $enum_tag = Db::name('enum_tag')->field('id,name')->order('weight desc,id desc')->select();
  55. $enum_wages = Db::name('enum_wages')->field('id,name')->order('weight desc,id desc')->select();
  56. $data = [
  57. 'enum_hobby' => $enum_hobby,
  58. 'enum_job' => $enum_job,
  59. 'enum_marital' => $enum_marital,
  60. 'enum_suqiu' => $enum_suqiu,
  61. 'enum_tag' => $enum_tag,
  62. 'enum_wages' => $enum_wages,
  63. ];
  64. $this->success('success',$data);
  65. }
  66. //关键字过滤
  67. public function keyworld_config(){
  68. $config = config('keyworld');
  69. $this->success('success',$config);
  70. }
  71. }