where(['label' => 'H5配置版本'])->first(); $version = $version->value; return \Yz::Return(true, '获取成功', [ 'version' => $version ]); } //获取基础信息 public function BaseInfo(){ $openid = request('openid'); $hospital_id = request('hospital_id'); $user = DB::table('web_users')->where(['openid' => $openid, 'is_del' => 0])->first(); if (!$user) return \Yz::echoError1("openid对应用户不存在"); $person = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0, 'is_default' => 1])->first(); if (!$person) return \Yz::echoError1("请选择就诊人"); $personCount = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->count(); $hospital=DB::table('hospitals')->where(['id' => $hospital_id])->first(); if (!$hospital) { return \Yz::echoError1("医院不存在"); } $info =[ 'person' => [ 'name' => $person->name, 'sex' => $person->sex, 'count' => $personCount ], 'hospital' => [ 'name' => $hospital->name, ] ] ; return \Yz::Return(true, '获取成功', $info); } // 获取配置更新时间 public function config() { $hospitals = DB::table('hospitals') ->select("id", "name", "latitude", "longitude", "logo","address") ->where(['status' => 1, 'is_del' => 0])->get(); if (count($hospitals) < 1) return \Yz::echoError1('暂无可用医院信息'); $db_config = DB::table('configs')->whereIn('label', ['首页欢迎词', '首页banner','首页轮播图'])->get(); $config = [ 'hospital' => $hospitals, // [[ // 'id' => 1, // 'name' => '秀英院区', // 'latitude' => '39.867671', // 'longitude' => '119.514223', // ]] 'tip' => $this->getValueByLabel($db_config, '首页欢迎词'), 'logo' => $hospitals[0]->logo, 'lunbo'=>json_decode( $this->getValueByLabel($db_config, '首页轮播图'),true), 'banner' => [ 'image' => $this->getValueByLabel($db_config, '首页banner'), 'jump' => 'https://www.hnxd.org/list-jkglzx.html', ], 'order' => [[ 'message' => '', 'name' => '个人体检预约', //'jump' => '/pages/buy/choose/choose?url=api://CheckUpTypeGetList', 'jump' => '/pages/main/yytjsj/yytjsj_front', 'icon' => '/assets/h5/gejianyuyue.png' ], [ 'message' => '', 'name' => '单位体检预约', 'jump' => '/pages/main/tj/choose', 'icon' => '/assets/h5/tuanjianyuyue.png' ]], 'button' => [[[ 'message' => '', 'name' => '报告解读预约', 'jump' => 'XCX/pages/other/entry/index?path=/pages/outpatient/doctor-appointment/index&scene=1002&hospitalAreaId=6&departmentCode=A0030077&subDepartmentCode=4773794195699464904', 'icon' => '/assets/h5/a_jiedubaogao.png' ],[ 'message' => '', 'name' => '购买套餐', 'jump' => '/pages/main/combo/combo', 'icon' => '/assets/h5/a_manyidudiaocha.png' ], [ 'message' => '', 'name' => '预检咨询', 'jump' => '/pages/main/tj/zhuanjiaxq?comboid=2814', 'icon' => '/assets/h5/yujianzx.png' ],[ 'message' => '', 'name' => '婚检预约', 'jump' => '/pages/premarital/readme/readme', 'icon' => '/assets/h5/hunjianyy.png' ]], [[ 'message' => '', 'name' => '转赠码核销', 'jump' => '/pages/buy/choose/sanfang', 'icon' => '/assets/h5/a_jiankangzhidao.png' ], [ 'message' => '', 'name' => '体检注意事项', 'jump' => '/pages/posts/posts/posts?type=2', 'icon' => '/assets/h5/a_tijianzhuyishixiang.png' ], [ 'message' => '', 'name' => '体检引导', 'jump' => '/pages/user/pick/pick', 'icon' => '/assets/h5/a_tijianyindao.png' ],[ 'message' => '', 'name' => '健康问卷', 'jump' => '/pages/main/question/choose/choose', 'icon' => '/assets/h5/a_jiankangwenjuan.png' ],], [[ 'message' => '', 'name' => '健康指导', 'jump' => '/pages/posts/posts/posts?type=1', 'icon' => '/assets/h5/a_jiankangzhidao.png' ], // [ // 'message' => '', // 'name' => '报告查询', // 'jump' => '/pages/main/bgcx/bgcx', // 'icon' => '/assets/h5/a_baogaochaxun.png' // ], [ 'message' => '', 'name' => '健康宣教', 'jump' => '/pages/posts/posts/posts?type=4', 'icon' => '/assets/h5/xuanjiao.png' ], [ 'message' => '', 'name' => '满意度调查', 'jump' => '/pages/main/questionnaire/index', 'icon' => '/assets/h5/a_manyidudiaocha.png' ] // , // // [ // 'message' => '', // 'name' => '我的订单', // 'jump' => '/pages/main/order/order', // 'icon' => '/assets/h5/a_wodedingdan.png' // ] ] ], 'color' => true, ]; return \Yz::Return(true, '获取成功', [ 'config' => $config ]); } //点击个检获取页面按钮 public function GetGeJianButtonList() { $list = [ [ 'message' => '', 'name' => '检前健康评估', 'url' => '/pages/main/question/question/question?id=4', 'logo' => '/assets/h5/zhuyishixiang.png' ], [ 'message' => '', 'name' => '套餐预约', 'url' => '/pages/main/combo/combo', 'logo' => '/assets/h5/zhuyishixiang.png' ], [ 'message' => '', 'name' => '项目自选', 'url' => '/pages/main/tj/tjzx', 'logo' => '/assets/h5/zhuyishixiang.png' ] ]; return \Yz::Return(true, "查询完成", ['list' => $list]); } //获取首页相关信息通知 public function GetHomeNotice() { $openid = request('openid'); $person_id = request('person_id'); $id_number = request('id_number'); $user = DB::table('web_users')->where(['openid' => $openid, 'is_del' => 0])->first(); if (!$user) return \Yz::echoError1("openid对应用户不存在"); $order_count=0; $tjyd_count=0;//体检引导 $bgcx_count=0;//报告查询 $order_count=DB::table('orders')->where(['web_user_id'=>$user->id,'status'=>2]) ->where(function($query) { $query->where('appointment_number', '=', '') ->orWhereNull('appointment_number'); })->count(); if(isset($person_id)){ $tjyd_count=DB::table('orders')->where(['person_id'=>$person_id,'status'=>4,'check_read_status'=>1])->count(); } if(isset($id_number)){ $bgcx_count=DB::table('report_l1_records')->where(['证件号码'=>$id_number,'is_read'=>0])->whereIn('体检状态',['报告已出','总检完成'])->count(); } $return_data=[ ['label'=>'我的订单','value' => $order_count], ['label'=>'体检引导','value' => $tjyd_count], ['label'=>'报告查询','value' => $bgcx_count] ]; return \Yz::Return(true,"查询完成",$return_data); } function getValueByLabel($items, $label) { foreach ($items as $item) { if ($item->label === $label) { return $item->value; } } return null; // 如果没有找到匹配的 label,则返回 null } }