|
@@ -91,7 +91,11 @@ class Application extends Base
|
|
|
->where('sc.status', 1)
|
|
|
->order('sr.sort asc')
|
|
|
->order('sc.sort asc')
|
|
|
+<<<<<<< HEAD
|
|
|
->field('sc.hid, sc.did, sc.id, sc.cost, sc.describe, sr.id as sid, sr.name, sr.color, d.realname as dname, i.name as hname')
|
|
|
+=======
|
|
|
+ ->field('sc.hid, sc.did, sc.id, sc.cost, sc.describe, sr.id as sid, sr.name, sr.check, sr.color, d.realname as dname, i.name as hname')
|
|
|
+>>>>>>> 8a36d64298b2e5db9528fcd4e90cd67e922c413f
|
|
|
->select();
|
|
|
// 特殊机构
|
|
|
if(!empty($special_doctors)) {
|
|
@@ -112,7 +116,8 @@ class Application extends Base
|
|
|
"id" => $v['hid'],
|
|
|
"name" => $v['name'],
|
|
|
"color" => $v['color'],
|
|
|
- "sid" => $v['sid']
|
|
|
+ "sid" => $v['sid'],
|
|
|
+ "check" => $v['check']
|
|
|
];
|
|
|
} else {
|
|
|
$super_hospitals[$v['hid']]['doctor'][] = [
|
|
@@ -417,6 +422,8 @@ class Application extends Base
|
|
|
$application_info['phone'] = $param['phone']?? '';
|
|
|
$application_info['remote_doctor_id'] = $remote_doctor_id;
|
|
|
$application_info['attachment'] = isset($param['attachment']) ? $param['attachment'] : '';
|
|
|
+ $application_info['sid'] = isset($param['sid']) ? $param['sid'] : null;
|
|
|
+ $application_info['scid'] = isset($param['scid']) ? $param['scid'] : null;
|
|
|
// $remote_application = DB::table('remote_application')->where('exam_id',$param['id'])->select();
|
|
|
// 申请远程
|
|
|
// if(empty($remote_application)){
|
|
@@ -451,6 +458,7 @@ class Application extends Base
|
|
|
// $r = DB::table('remote_application')->where('exam_id',$param['id'])->field('id')->find();
|
|
|
// $aid = $r['id'];
|
|
|
// }
|
|
|
+
|
|
|
if(isset($param['apply']) && !empty($param['apply'])){
|
|
|
$institution_id = $doctor['institution_id'];
|
|
|
$lower_hospital = DB::table('institution')->where('id', $institution_id)->field('is_pay')->find();
|
|
@@ -464,6 +472,8 @@ class Application extends Base
|
|
|
$is_urgent = $application['is_urgent'];
|
|
|
$local_institution_id = $application['local_institution_id'];
|
|
|
$req_doctor_id = $application['req_doctor_id'];
|
|
|
+ $sid = $application['sid'];
|
|
|
+ $scid = $application['scid'];
|
|
|
if(empty($remote_institution_id)) {
|
|
|
return json_encode(['status'=>'fail','code'=>'2012','msg'=> '远程机构id为空']);
|
|
|
}
|
|
@@ -476,7 +486,12 @@ class Application extends Base
|
|
|
if(empty($req_doctor_id)) {
|
|
|
return json_encode(['status'=>'fail','code'=>'2015','msg'=> '本地医生id为空']);
|
|
|
}
|
|
|
- if($is_pay === 1) {
|
|
|
+
|
|
|
+ if(!empty($sid) && empty($scid)) {
|
|
|
+ return json_encode(['status'=>'fail','code'=>'2016','msg'=> '请选择问诊医生']);
|
|
|
+ }
|
|
|
+
|
|
|
+ if($is_pay === 1 && empty($sid)) {
|
|
|
$cost = DB::table('remote_cost')
|
|
|
->where('hospital_id', $local_institution_id)
|
|
|
->where('super_hospital_id', $remote_institution_id)
|