Baseconfig.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace app\api\controller\worker;
  3. use app\common\controller\Apiw;
  4. use think\Db;
  5. /**
  6. * 基础配置接口
  7. */
  8. class Baseconfig extends Apiw
  9. {
  10. protected $noNeedLogin = ['app_version'];
  11. protected $noNeedRight = ['*'];
  12. public function index(){
  13. //维保公司的客服
  14. // $kefu = Db::name('pc_admin')->where('company_id',$this->auth->company_id)->order('is_kefu desc,id asc')->find();
  15. $company = Db::name('company')->where('id',$this->auth->company_id)->find();
  16. $config = [
  17. 'company_im_kefu' => 'kefu_'.$this->auth->company_id,
  18. 'company_mobile' => $company['mobile'],
  19. ];
  20. $this->success('success',$config);
  21. }
  22. //给师傅端用的usersig
  23. //user_用户端小程序,master_师傅,kefu_客服
  24. public function tenim_usersig(){
  25. $user_id = "master_".$this->auth->id;
  26. // 获取配置信息
  27. $config = config("tencent_im");
  28. // $usersigObj = new getusersig($config["sdkappid"],$config["key"]);
  29. // $usersig = $usersigObj->genUserSig($user_id);
  30. $rs = [
  31. // 'usersig' => $usersig,
  32. 'sdkappid' => $config['sdkappid'],
  33. ];
  34. $this->success(1,$rs);
  35. }
  36. //师傅端版本
  37. public function app_version(){
  38. $config = [
  39. 'android_update_num' => config('site.worker_android_update_num'), //android版本迭代号
  40. 'android_update_version' => config('site.worker_android_update_version'), //android展示版本号
  41. 'android_download_url' => config('site.worker_android_download_url'), //android下载链接
  42. 'android_update_force' => config('site.worker_android_update_force'), //android是否强制更新
  43. 'android_update_title' => config('site.worker_android_update_title'), //android更新标题
  44. 'android_update_info' => config('site.worker_android_update_info'), //android更新描述
  45. 'ios_update_num' => config('site.worker_ios_update_num'), //ios版本迭代号
  46. 'ios_update_version' => config('site.worker_ios_update_version'), //ios展示版本号
  47. 'ios_download_url' => config('site.worker_ios_download_url'), //ios下载链接
  48. 'ios_update_force' => config('site.worker_ios_update_force'), //ios是否强制更新
  49. 'ios_update_title' => config('site.worker_ios_update_title'), //ios更新标题
  50. 'ios_update_info' => config('site.worker_ios_update_info'), //ios更新描述
  51. ];
  52. $this->success('success',$config);
  53. }
  54. //启动广告图
  55. public function start_advert(){
  56. $info = Db::name('start_advert')->where('is_show',1)->order('id desc')->find();
  57. $info = info_domain_image($info,['images','video_file']);
  58. $this->success_find('success',$info);
  59. }
  60. //关键字过滤
  61. public function keyworld_config(){
  62. $config = config('keyworld');
  63. $this->success('success',$config);
  64. }
  65. }