...
|
...
|
@@ -208,7 +208,7 @@ class Index extends Api |
|
|
->find();
|
|
|
!empty($has) && $this->error('您已预约,请勿重复操作');
|
|
|
// 是否可以预约,随机分配医生
|
|
|
$doctor = Doctor::alias('a')
|
|
|
$ok = Doctor::alias('a')
|
|
|
->join('doctor_nowork b','b.doctor_id = a.id and b.date = '.$post['date'],'left')
|
|
|
->join('appointment c','c.doctor_id = a.id and c.date = '.$post['date'].' and c.status in (1,2)','left')
|
|
|
// ->join('appointment c','c.doctor_id = a.id and c.date_time < '.$tomorrow_time.' and c.status in (1,2)','left')
|
...
|
...
|
@@ -216,10 +216,8 @@ class Index extends Api |
|
|
->where('c.id',null)
|
|
|
->where('a.id',$post['doctor_id'])
|
|
|
->field('a.id')
|
|
|
->orderRaw('rand()')
|
|
|
->limit(1)
|
|
|
->select();
|
|
|
count($doctor) < 1 && $this->error('已被预约满了,请再等等或选择其他日期预约');
|
|
|
->find();
|
|
|
empty($ok) && $this->error('已被预约满了,请再等等或选择其他日期预约');
|
|
|
$dept_ids = Dept::where('id','in',$doctor['dept_ids'])->where('pid',0)->column('id');
|
|
|
$dept_ids = implode(',',$dept_ids);
|
|
|
$pay_fee = $post['type'] == 1 ? $doctor['text_price'] : $doctor['audio_price'];
|
...
|
...
|
|