Config.php 1.1 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 获取配置
  7. */
  8. namespace app\green\controller\api\v1;
  9. use app\green\controller\api\Base;
  10. use app\green\model\GreenAdwords;
  11. use app\green\model\GreenConfig;
  12. class Config extends Base{
  13. /**
  14. * 获取应用配置
  15. **/
  16. public function index(){
  17. $info = GreenConfig::getConfig($this->miniapp->id);
  18. $config = $info->config ? json_decode($info->config) : [];
  19. $config['service_telephone'] = $info->service_telephone ??'';
  20. $config['shore_img'] = $config->shore_img ??'';
  21. $config['shore_text'] = $config->shore_text ??'';
  22. $config['help'] = $info->help ? str_replace('<img', '<img class="img" style="max-width:100%;height:auto"',dehtml($info->help)):'';
  23. $config['icon'] = GreenAdwords::where(['member_miniapp_id' => $this->miniapp_id])->order('sort desc,id desc')->select()->toArray();
  24. return enjson(200,'应用配置',$config);
  25. }
  26. }