Config.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +---------------------------------------------------------------------+
  3. // | NiuCloud | [ WE CAN DO IT JUST NiuCloud ]  |
  4. // +---------------------------------------------------------------------+
  5. // | Copy right 2019-2029 www.niucloud.com  |
  6. // +---------------------------------------------------------------------+
  7. // | Author | NiuCloud <niucloud@outlook.com>  |
  8. // +---------------------------------------------------------------------+
  9. // | Repository | https://github.com/niucloud/framework.git  |
  10. // +---------------------------------------------------------------------+
  11. namespace addon\weapp\model;
  12. use app\model\system\Config as ConfigModel;
  13. use app\model\BaseModel;
  14. /**
  15. * 微信小程序配置
  16. */
  17. class Config extends BaseModel
  18. {
  19. /******************************************************************** 微信小程序配置 start ****************************************************************************/
  20. /**
  21. * 设置微信小程序配置
  22. * @return multitype:string mixed
  23. */
  24. public function setWeappConfig($data, $is_use)
  25. {
  26. $config = new ConfigModel();
  27. $res = $config->setConfig($data, '微信公小程序设置', $is_use, [['site_id', '=', 0], ['app_module', '=', 'admin'], ['config_key', '=', 'WEAPP_CONFIG']]);
  28. return $res;
  29. }
  30. /**
  31. * 获取微信小程序配置信息
  32. * @return multitype:string mixed
  33. */
  34. public function getWeappConfig()
  35. {
  36. $config = new ConfigModel();
  37. $res = $config->getConfig([['site_id', '=', 0], ['app_module', '=', 'admin'], ['config_key', '=', 'WEAPP_CONFIG']]);
  38. return $res;
  39. }
  40. /******************************************************************** 微信小程序配置 end ****************************************************************************/
  41. }