|
@@ -80,6 +80,56 @@ class Application extends Base
|
|
|
$hospital = DB::table('institution')->where('id',$institution_id)->find();
|
|
|
$is_pay = $hospital['is_pay'];
|
|
|
$parent_name = array();
|
|
|
+
|
|
|
+ // 特殊机构
|
|
|
+ $special_doctors = Db::table('special_contact')
|
|
|
+ ->alias("sc")
|
|
|
+ ->join('doctors d', 'sc.did = d.id')
|
|
|
+ ->join('institution i', 'sc.hid = i.id')
|
|
|
+ ->join('special_remote sr', 'sc.sid = sc.id')
|
|
|
+ ->where('sr.status', 1)
|
|
|
+ ->where('sc.status', 1)
|
|
|
+ ->order('sr.sort asc')
|
|
|
+ ->order('sc.sort asc')
|
|
|
+ ->field('sc.hid, sc.did, sc.id, sc.cost, sc.describe, sr.name, sr.color, d.name as dname, i.name as hname')
|
|
|
+ ->select();
|
|
|
+ // 特殊机构
|
|
|
+ if(!empty($special_doctors)) {
|
|
|
+ $special_hospitals = array();
|
|
|
+ foreach($special_doctors as $v) {
|
|
|
+ if(!isset($special_doctors[$v['hid']])){
|
|
|
+ $super_hospitals[$v['hid']] = [
|
|
|
+ "doctor" => [
|
|
|
+ [
|
|
|
+ "id" => $v['did'],
|
|
|
+ "is_admin" => '0',
|
|
|
+ "realname" => $v['dname'],
|
|
|
+ "describe" => $v['describe'],
|
|
|
+ "hname" => $v['hname'],
|
|
|
+ "scid" => $v['id']
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ "id" => $v['hid'],
|
|
|
+ "name" => $v['name'],
|
|
|
+ "color" => $v['color'],
|
|
|
+ "sid" => $v['sid']
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ $super_hospitals[$v['hid']]['doctor'][] = [
|
|
|
+ "id" => $v['did'],
|
|
|
+ "is_admin" => '0',
|
|
|
+ "realname" => $v['dname'],
|
|
|
+ "describe" => $v['describe'],
|
|
|
+ "hname" => $v['hname'],
|
|
|
+ "scid" => $v['id']
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ foreach($super_hospitals as $v) {
|
|
|
+ $parent_name[] = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// select rc1.hospital_id, rc1.super_hospital_id, rc1.hospital_name, rc1.super_hospital_name, rc1.pay_type, rc2.super_doctor_id, rc2.super_doctor_name, rc2.exam_class from remote_contact rc1 join remote_cost rc2 on rc1.hospital_id = rc2.hospital_id and rc1.super_hospital_id = rc2.super_hospital_id where rc1.hospital_id = '13000003' and rc2.exam_class='CT' order by rc1.sort, rc2.sort
|
|
|
if($is_pay === 1) {
|
|
|
$super_hospitals = array();
|