Baseconfig.php 3.0 KB

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