Common.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. ->where('ph', 0)
  22. ->select();
  23. HelpHander::success($lists);
  24. }
  25. public function getOrg() {
  26. $info = (new Org())->getInfo($this->orgId);
  27. if (!$info) {
  28. HelpHander::error('项目不存在');
  29. }
  30. HelpHander::success($info);
  31. }
  32. // 获取系统配置
  33. public function getConfig() {
  34. $name = input('name', '', 'trim');
  35. $wyval = (new Config())->getConfig($name, $this->orgId);
  36. HelpHander::success(['val' => $wyval]);
  37. }
  38. public function phprotocol() {
  39. $info = Db::name("ph_protocol")->where('org_id',$this->orgId)->find();
  40. if (!$info) {
  41. HelpHander::success(['content'=>""]);
  42. }
  43. HelpHander::success(['content' => $info['content']]);
  44. }
  45. }