|
@@ -14,7 +14,21 @@ class Tvdoctor extends Api
|
|
|
|
|
|
//科室列表
|
|
|
public function keshi_list(){
|
|
|
- $list = Db::name('keshi')->where('is_show',1)->order('weigh','desc')->select();
|
|
|
+
|
|
|
+ //所有医生,所在的科室
|
|
|
+ $where = [
|
|
|
+ 'd.status' => 1,
|
|
|
+ 'd.doctor_status' => 1,
|
|
|
+ 'info.video_switch' => 1,
|
|
|
+ 'info.video_model' => 2,//只要即时的
|
|
|
+ ];
|
|
|
+ $keshi_ids = Db::name('doctor')->alias('d')
|
|
|
+ ->join('doctor_info info','d.id = info.doctor_id','LEFT')
|
|
|
+ ->where($where)->column('keshi_id');
|
|
|
+
|
|
|
+ //所有科室,没医生的科室就不要了
|
|
|
+ $list = Db::name('keshi')->where('is_show',1)->where('id','IN',$keshi_ids)->order('weigh','desc')->select();
|
|
|
+
|
|
|
$this->success(1,$list);
|
|
|
}
|
|
|
|