Org.php 753 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\api\controller\h5;
  3. use app\hander\HelpHander;
  4. use think\Controller;
  5. use think\Db;
  6. class Org extends Controller
  7. {
  8. public function info(){
  9. $orgId = input('orgId/d',0);
  10. $info = Db::name('org')->field('id,name')->where('id',$orgId)->where('del',0)->where('parent_id','>',0)->find();
  11. if($info){
  12. HelpHander::success($info);
  13. }else{
  14. HelpHander::error('信息不存在');
  15. }
  16. }
  17. // 获取所有开通的项目
  18. public function lists(){
  19. $lists = Db::name('org')
  20. ->field('id,name')
  21. ->where('del',0)
  22. ->where('enable',1)
  23. ->where('type',2)
  24. ->select();
  25. HelpHander::success($lists);
  26. }
  27. }