0
0

Common.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\hander\HelpHander;
  4. use think\Controller;
  5. use think\Db;
  6. // 不需要登录信息的接口写这
  7. class Common extends Controller
  8. {
  9. public function newAppMgr(){
  10. $ret = Db::name('app_mgr')
  11. ->where(['enable'=>1, 'del'=>0])
  12. ->order('id desc')
  13. ->find();
  14. if($ret){
  15. HelpHander::success($ret);
  16. }else{
  17. HelpHander::error('暂无数据');
  18. }
  19. }
  20. public function newAppIos(){
  21. $ret = Db::name('app_ios')
  22. ->where(['enable'=>1, 'del'=>0])
  23. ->order('id desc')
  24. ->find();
  25. if($ret){
  26. HelpHander::success($ret);
  27. }else{
  28. HelpHander::error('暂无数据');
  29. }
  30. }
  31. public function staticUrl(){
  32. $data=[
  33. 'adoutUsUrl' => url('h5/Index/sysarticle',['name'=>'about'],false,true),
  34. 'privacyPolicyUrl' => url('h5/Index/sysarticle',['name'=>'privacy'],false,true),
  35. 'disclaimerUrl' => url('h5/Index/sysarticle',['name'=>'disclaimer'],false,true),
  36. ];
  37. HelpHander::success($data);
  38. }
  39. public function deps(){
  40. $orgId = input('orgId/d',0);
  41. $deps = Db::name('dep')
  42. ->where('org_id',$orgId)
  43. ->where('del',0)
  44. ->where('enable',1)
  45. ->field('id,title')
  46. ->select();
  47. $deps = $deps?$deps:[];
  48. HelpHander::success($deps,'成功');
  49. }
  50. }