Baseconfig.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 基础配置接口
  7. */
  8. class Baseconfig extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. public function index(){
  13. $config = [
  14. 'kefu_mobile' => config('site.kefu_mobile'),
  15. 'kefu_weixin_qrcode' => localpath_to_netpath(config('site.kefu_weixin_qrcode')),
  16. ];
  17. $this->success('success',$config);
  18. }
  19. public function school_list(){
  20. $list = Db::name('school')->order('weigh desc,id desc')->select();
  21. $this->success('success',$list);
  22. }
  23. public function grade_list(){
  24. $school_id = input('school_id',1);
  25. $list = Db::name('grade')->where('school_id',$school_id)->order('weigh desc,id desc')->select();
  26. $this->success('success',$list);
  27. }
  28. public function classes_list(){
  29. $grade_id = input('grade_id',1);
  30. $list = Db::name('classes')->where('grade_id',$grade_id)->order('weigh desc,id desc')->select();
  31. $this->success('success',$list);
  32. }
  33. }