Baseconfig.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. /**
  13. * 获取安卓版本更新信息
  14. */
  15. public function getandroidEdition() {
  16. // 获取二维码
  17. $is_force = config("site.android_is_force");
  18. $apkUrl = config("site.android_apkUrl");
  19. $apkName = config("site.android_apkName");
  20. $desc = config("site.android_desc");
  21. $versionCode = config("site.android_versionCode");
  22. $this->success("获取成功!",["versionCode"=>$versionCode,"isForceUpdate"=>$is_force,"apkUrl"=>$apkUrl,"apkName"=>$apkName,"desc"=>$desc]);
  23. }
  24. /**
  25. * 获取ios版本更新信息
  26. */
  27. public function getiosEdition() {
  28. // 获取二维码
  29. $is_force = config("site.iso_is_force");
  30. $apkUrl = config("site.ios_downurl");
  31. $apkName = config("site.iso_appname");
  32. $desc = config("site.iso_desc");
  33. $versionCode = config("site.iso_versioncode");
  34. $this->success("获取成功!",["versionCode"=>$versionCode,"isForceUpdate"=>$is_force,"apkUrl"=>$apkUrl,"apkName"=>$apkName,"desc"=>$desc]);
  35. }
  36. //启动广告图
  37. public function start_advert(){
  38. $info = Db::name('start_advert')->where('is_show',1)->order('id desc')->find();
  39. $info = info_domain_image($info,['images','video_file']);
  40. $this->success_find('success',$info);
  41. }
  42. //个人资料的一下枚举
  43. public function userinfo_enum(){
  44. $enum_hobby = Db::name('enum_hobby')->field('id,name')->order('weight desc,id desc')->select();
  45. $enum_job = Db::name('enum_job')->field('id,name')->order('weight desc,id desc')->select();
  46. $enum_marital = Db::name('enum_marital')->field('id,name')->order('weight desc,id desc')->select();
  47. $enum_suqiu = Db::name('enum_suqiu')->field('id,name')->order('weight desc,id desc')->select();
  48. $enum_tag = Db::name('enum_tag')->field('id,name')->order('weight desc,id desc')->select();
  49. $enum_wages = Db::name('enum_wages')->field('id,name')->order('weight desc,id desc')->select();
  50. $data = [
  51. 'enum_hobby' => $enum_hobby,
  52. 'enum_job' => $enum_job,
  53. 'enum_marital' => $enum_marital,
  54. 'enum_suqiu' => $enum_suqiu,
  55. 'enum_tag' => $enum_tag,
  56. 'enum_wages' => $enum_wages,
  57. ];
  58. $this->success('success',$data);
  59. }
  60. //////////////////////////////上面没用到///////////////////////////
  61. public function index(){
  62. $config = [
  63. 'kefu_mobile' => config('site.kefu_mobile'),//客服电话
  64. ];
  65. $this->success('success',$config);
  66. }
  67. //关键字过滤
  68. public function keyworld_config(){
  69. $config = config('keyworld');
  70. $this->success('success',$config);
  71. }
  72. }