Common.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\api\controller\h5;
  3. use app\common\model\Banner;
  4. use app\common\model\Config;
  5. use app\common\model\Org;
  6. use app\hander\HelpHander;
  7. use think\Controller;
  8. use think\Db;
  9. use think\Exception;
  10. class Common extends Base {
  11. public function banner() {
  12. $ret = model('Banner')->getList(5, 1);
  13. HelpHander::success($ret);
  14. }
  15. public function dep() {
  16. $lists = Db::name('dep')
  17. ->field('id,title')
  18. ->where('org_id', $this->orgId)
  19. ->where('enable', 1)
  20. ->where('del', 0)
  21. ->select();
  22. HelpHander::success($lists);
  23. }
  24. public function getOrg() {
  25. $info = (new Org())->getInfo($this->orgId);
  26. if (!$info) {
  27. HelpHander::error('项目不存在');
  28. }
  29. HelpHander::success($info);
  30. }
  31. // 获取系统配置
  32. public function getConfig() {
  33. $name = input('name', '', 'trim');
  34. $wyval = (new Config())->getConfig($name, $this->orgId);
  35. HelpHander::success(['val' => $wyval]);
  36. }
  37. }