|
@@ -134,7 +134,7 @@ class Reciveremote extends Base
|
|
|
// }
|
|
|
log::record($sql);
|
|
|
$list = DB::query($sql);
|
|
|
- $csql = "SELECT count(1) from exams as e,remote_application as ra,patient_infos as p,report as r where ra.exam_id=e.id and e.patient_id=p.id and r.exam_id=e.id and ra.remote_institution_id='" . $doctor['institution_id']."'".$where;
|
|
|
+ $csql = "SELECT count(1) from exams as e,remote_application as ra,patient_infos as p,report as r where (ra.remote_doctor_id='".$doctor['id']."' or ra.remote_doctor_id='') and ra.exam_id=e.id and e.patient_id=p.id and r.exam_id=e.id and ra.remote_institution_id='" . $doctor['institution_id']."'".$where;
|
|
|
$count = DB::query($csql);
|
|
|
foreach ($list as $k => $v) {
|
|
|
$cache_key = $doctor['id'].'_'.$v['id'];
|