1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\api\controller\h5;
- use app\common\model\Banner;
- use app\common\model\Config;
- use app\common\model\Org;
- use app\hander\HelpHander;
- use think\Controller;
- use think\Db;
- use think\Exception;
- class Common extends Base {
- public function banner() {
- $ret = model('Banner')->getList(5, 1);
- HelpHander::success($ret);
- }
- public function dep() {
- $lists = Db::name('dep')
- ->field('id,title')
- ->where('org_id', $this->orgId)
- ->where('enable', 1)
- ->where('del', 0)
- ->select();
- HelpHander::success($lists);
- }
- public function getOrg() {
- $info = (new Org())->getInfo($this->orgId);
- if (!$info) {
- HelpHander::error('项目不存在');
- }
- HelpHander::success($info);
- }
- // 获取系统配置
- public function getConfig() {
- $name = input('name', '', 'trim');
- $wyval = (new Config())->getConfig($name, $this->orgId);
- HelpHander::success(['val' => $wyval]);
- }
- public function phprotocol() {
- $info = Db::name("ph_protocol")->where('org_id',$this->orgId)->find();
- if (!$info) {
- HelpHander::success(['content'=>""]);
- }
- HelpHander::success(['content' => $info['content']]);
- }
- }
|