Baseconfig.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. 'no_screenshot' => config('site.no_screenshot'), //禁止截图
  15. 'show_wechat_pay' => config('site.show_wechat_pay'), //是否显示微信支付
  16. 'show_ali_pay' => config('site.show_ali_pay'), //是否显示支付宝支付
  17. 'show_intimacy' => config('site.show_intimacy'), //是否显示亲密度等级差
  18. ];
  19. $this->success('success',$config);
  20. }
  21. //启动广告图
  22. public function start_advert(){
  23. $info = Db::name('start_advert')->where('is_show',1)->order('id desc')->find();
  24. $info = info_domain_image($info,['images','video_file']);
  25. $this->success('success',$info);
  26. }
  27. //个人资料的一下枚举
  28. public function userinfo_enum(){
  29. $enum_hobby_type = Db::name('enum_hobby_type')->field('id,name')->order('weight desc,id desc')->select();
  30. $mt_enum_hobby = Db::name('enum_hobby');
  31. foreach ($enum_hobby_type as &$v) {
  32. $v['list'] = $mt_enum_hobby->where(['type_id' => $v['id']])->field('id,name')->order('weight desc,id desc')->select();
  33. }
  34. // $enum_hobby = Db::name('enum_hobby')->field('id,name')->order('weight desc,id desc')->select();
  35. $enum_job = Db::name('enum_job')->field('id,name')->order('weight desc,id desc')->select();
  36. $enum_marital = Db::name('enum_marital')->field('id,name')->order('weight desc,id desc')->select();
  37. $enum_education = Db::name('enum_education')->field('id,name')->order('weight desc,id desc')->select();
  38. $enum_tag = Db::name('enum_tag')->field('id,name')->order('weight desc,id desc')->select();
  39. $enum_wages = Db::name('enum_wages')->field('id,name')->order('weight desc,id desc')->select();
  40. $enum_character = Db::name('enum_character')->field('id,name')->order('weight desc,id desc')->select();
  41. $enum_constellation = Db::name('enum_constellation')->field('id,name')->order('weight desc,id desc')->select();
  42. $enum_stature = Db::name('enum_stature')->field('id,name')->order('weight desc,id desc')->select();
  43. $enum_live = Db::name('enum_live')->field('id,name')->order('weight desc,id desc')->select();
  44. $enum_car = Db::name('enum_car')->field('id,name')->order('weight desc,id desc')->select();
  45. $enum_chest = Db::name('enum_chest')->field('id,name')->order('weight desc,id desc')->select();
  46. $data = [
  47. 'enum_hobby' => $enum_hobby_type,
  48. 'enum_job' => $enum_job,
  49. 'enum_marital' => $enum_marital,
  50. 'enum_education' => $enum_education,
  51. 'enum_tag' => $enum_tag,
  52. 'enum_wages' => $enum_wages,
  53. 'enum_character' => $enum_character,
  54. 'enum_constellation' => $enum_constellation,
  55. 'enum_stature' => $enum_stature,
  56. 'enum_live' => $enum_live,
  57. 'enum_car' => $enum_car,
  58. 'enum_chest' => $enum_chest,
  59. ];
  60. $this->success('success',$data);
  61. }
  62. //关键字过滤
  63. public function keyworld_config(){
  64. $config = config('keyworld');
  65. $this->success('success',$config);
  66. }
  67. //获取版本更新信息
  68. public function getversion() {
  69. // 获取二维码
  70. $is_force = config("site.is_force"); //是否强制更新 1是 0否
  71. $apk_url = config("site.apk_url"); //下载链接
  72. $apk_name = config("site.apk_name"); //apk更新标题
  73. $apk_desc = config("site.apk_desc"); //apk更新描述
  74. $version_code = config("site.version_code"); //版本迭代号
  75. $update_version = config("site.android_update_version"); //安卓更新展示版本
  76. $data['is_force'] = $is_force;
  77. $data['apk_url'] = $apk_url;
  78. $data['apk_name'] = $apk_name;
  79. $data['apk_desc'] = $apk_desc;
  80. $data['version_code'] = $version_code;
  81. $data['update_version'] = $update_version;
  82. $this->success('Success', $data);
  83. }
  84. //获取ios版本更新信息
  85. public function getiosversion() {
  86. // 获取二维码
  87. $is_force = config("site.ios_is_force"); //是否强制更新 1是 0否
  88. $apk_url = config("site.ios_apk_url"); //下载链接
  89. $apk_name = config("site.ios_apk_name"); //apk更新标题
  90. $apk_desc = config("site.ios_apk_desc"); //apk更新描述
  91. $version_code = config("site.ios_version_code"); //版本迭代号
  92. $update_version = config("site.ios_update_version"); //ios更新展示版本
  93. $data['is_force'] = $is_force;
  94. $data['apk_url'] = $apk_url;
  95. $data['apk_name'] = $apk_name;
  96. $data['apk_desc'] = $apk_desc;
  97. $data['version_code'] = $version_code;
  98. $data['update_version'] = $update_version;
  99. $this->success('Success', $data);
  100. }
  101. }