Index.php 861 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 首页接口
  7. */
  8. class Index extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. /**
  13. * 首页
  14. *
  15. */
  16. public function index()
  17. {
  18. $this->success('请求成功');
  19. }
  20. //科室列表
  21. public function keshi_list(){
  22. $list = Db::name('keshi')->where('is_show',1)->order('weigh','desc')->select();
  23. $this->success(1,$list);
  24. }
  25. //名医推荐
  26. public function index_doctor(){
  27. $keshi_id = input('keshi_id',0);
  28. $where = [
  29. 'status' => 1,
  30. ];
  31. if($keshi_id){
  32. $where['keshi_id'] = $keshi_id;
  33. }
  34. $field = ['id,nickname,'];
  35. Db::name('doctor')->field($field)->where($where)->autopage()->select();
  36. }
  37. }