diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index d051277..b6fedbd 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -115,37 +115,7 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group 'color' => '#E9F8F3', ]; } -// $item = [ -// 'cover' => '/assets/h5/combo.png', -// 'name' => '中老年体检套餐(女)', -// 'sex' => 2, -// 'combo_type' => '1', -// 'person_type' => '1', -// 'tag' => [[ -// 'text' => '女已婚', -// 'text_color' => '#47ABD8', -// 'color' => '#EBF5FC', -// ], [ -// 'text' => '22个项目', -// 'text_color' => '#34C292', -// 'color' => '#E9F8F3', -// ]], -// 'desc' => ['血糖', '腹部超声', '心电图'], -// 'price' => '1229.00', -// 'original_price' => '2048.88', -// 'count' => '77' -// ]; -// $list = []; -// for ($i = 0; $i < 20; $i++) { -// $list[] = $item; -// } -// $hospital_info = [ -// 'id' => $hospital, -// 'name' => '秀英院区', -// 'address' => '秀英院区秀英院区秀英院区地址', -// 'latitude' => '39.867671', -// 'longitude' => '119.514223', -// ]; + $hospital_info = $hospital; $info = [ 'name' => $person->name, diff --git a/Laravel/app/Http/Controllers/API/H5/HomeController.php b/Laravel/app/Http/Controllers/API/H5/HomeController.php index 1c4b5c0..e0a0a71 100644 --- a/Laravel/app/Http/Controllers/API/H5/HomeController.php +++ b/Laravel/app/Http/Controllers/API/H5/HomeController.php @@ -70,9 +70,9 @@ class HomeController extends Controller 'jump' => '/pages/main/zysx/zysx', 'icon' => '/assets/h5/zhuyishixiang.png' ], [ - 'message' => '暂未开放', + 'message' => '', 'name' => '体检引导', - 'jump' => '/pages/main/cjwt/cjwt', + 'jump' => '/pages/user/pick/pick', 'icon' => '/assets/h5/changjianwenti.png' ]], [[ 'message' => '', diff --git a/Laravel/app/Http/Controllers/API/H5/QuestionController.php b/Laravel/app/Http/Controllers/API/H5/QuestionController.php index 2a0ebcf..8aaf69f 100644 --- a/Laravel/app/Http/Controllers/API/H5/QuestionController.php +++ b/Laravel/app/Http/Controllers/API/H5/QuestionController.php @@ -22,6 +22,8 @@ class QuestionController extends Controller ])->orderBy('order','asc')->get(); foreach ($list as $key=>$item){ $item->content=json_decode($item->content,true); + + } return \Yz::Return(true,"查询成功",['list'=>$list]); } diff --git a/Laravel/app/Http/Controllers/API/H5/ReportController.php b/Laravel/app/Http/Controllers/API/H5/ReportController.php index e1ef8ac..53d1859 100644 --- a/Laravel/app/Http/Controllers/API/H5/ReportController.php +++ b/Laravel/app/Http/Controllers/API/H5/ReportController.php @@ -390,6 +390,124 @@ class ReportController extends Controller $data_arr = []; $res_done_arr = []; //查询数据库 - $reports=DB::table('') + $reports=DB::table('report_l1_records')->where(['证件号码'=>$id_number]) + ->whereIn('体检状态',['报告已出','总检完成'])->orderBy('报告日期','asc')->get(); + $date_list = []; + $datetime = ''; + foreach ($reports as $item) { + $datetime=explode('T', $item['登记时间'])[0]; + $jc_item=DB::table('report_l2_items as a')->leftJoin(['report_l3_base_items as b','a.id','=','b.report_l2_id'])->where(['a.reprort_l1_id'=>$item->id])->get(); + foreach ($jc_item as $i) { + if ($i['基础项目代码'] == $mark) { + if ($i['结果类型'] == '数值' && !!$i['结果值范围']) { + $date_list[] = $datetime; + $result = '正常'; + if ($i['异常标识'] == '↑') $result = '偏高'; + if ($i['异常标识'] == '↓') $result = '偏低'; + $range_str = $i['结果值范围']; + if (strtotime($datetime) > $time) { + $info['result'] = $result; + $info['value'] = $i['异常标识'] . $i['结果值'] . $i['结果值单位']; + $value = $i['结果值']; + $data_arr[] = [ + 'value' => $value, + 'datetime' => $datetime, + ]; + $unit = $i['结果值单位']; + $info['date'] = $datetime; + $time = strtotime($datetime); + } + $info['name'] = $i['基础项目名称']; + $info['table']['name'] = $i['基础项目名称']; + $info['table']['list'][] = [ + 'date' => $datetime, + 'value' => $i['异常标识'] . $i['结果值'], + 'assess' => $result, + ]; + } + } + } + } + if ($date == '') $date = $datetime; + $rc = 0; + foreach ($reports as $item) { + $datetime=explode('T', $item['登记时间'])[0]; + $jc_item=DB::table('report_l2_items as a')->leftJoin(['report_l3_base_items as b','a.id','=','b.report_l2_id'])->where(['a.reprort_l1_id'=>$item->id])->get(); + foreach ($jc_item as $i) { + if ($i['基础项目代码'] == $mark) { + $result = '正常'; + if ($i['异常标识'] == '↑') $result = '偏高'; + if ($i['异常标识'] == '↓') $result = '偏低'; + if ($datetime == $date) { + $info['result'] = $result; + $info['value'] = $i['异常标识'] . $i['结果值'] . $i['结果值单位']; + $value = $i['结果值']; + $unit = $i['结果值单位']; + $info['date'] = $datetime; + $rc++; + } + $info['name'] = $i['基础项目名称']; + $info['table']['name'] = $i['基础项目名称']; + } + } + } + + $chart1_option = [ + 'show' => true, + 'range' => [], + 'min' => 0, + 'max' => 0, + 'value' => $value, + 'label' => $label, + ]; + $chart2_option = [ + 'show' => true, + 'data' => $data_arr, + 'min' => 0, + 'max' => 0, + 'unit' => $unit, + 'step' => $step, + 'range' => [], + ]; + + $data_show = true; + if (!$range_str) { + $data_show = false; + $chart1_option['show'] = false; + $chart2_option['show'] = false; + } else if (strstr($range_str, '>') || strstr($range_str, '<')) { + $data_show = false; + $chart1_option['show'] = false; + $chart2_option['show'] = false; + } else { + $range_str = str_replace('~~', '-', $range_str); + $range_str = str_replace('--', '-', $range_str); + $range_str = str_replace('~', '-', $range_str); + $range_arr = explode('-', $range_str); + $min_index = array_search("min", $range); + $max_index = array_search("max", $range); + $range[$min_index] = $range_arr[0]; + $range[$max_index] = $range_arr[1]; + $chart1_option['min'] = $range_arr[0]; + $chart1_option['max'] = $range_arr[1]; + $chart2_option['range'] = $range_arr; + $chart2_option['min'] = $range[0]; + $chart2_option['max'] = $range[count($range) - 1]; + foreach ($range as $key => $item) { + $chart1_option['range'][] = [ + 'percent' => $item / ($range[count($range) - 1] - $range[0]), + 'value' => $item, + 'color' => $color[$key - $min_index + 1], + ]; + } + } + return \Yz::return(true,"查询完成",[ + 'date' => $date, + 'date_list' => $date_list, + 'show' => $data_show, + 'info' => $info, + 'chart1_option' => $chart1_option, + 'chart2_option' => $chart2_option, + ]); } } diff --git a/Laravel/app/Http/Controllers/API/Web/ComboController.php b/Laravel/app/Http/Controllers/API/Web/ComboController.php new file mode 100644 index 0000000..2122ac9 --- /dev/null +++ b/Laravel/app/Http/Controllers/API/Web/ComboController.php @@ -0,0 +1,97 @@ +select('id', 'name', 'address', 'latitude', 'longitude')->where(['id' => $hospital])->first(); + + $canshu = []; + $canshu[]=$sex; + $sql = ''; + if (isset($combo_price)) { + $price_list = [ + "1" => [0, 299], + "2" => [300, 999], + "3" => [1000, 1499], + "4" => [1500, 2999], + "5" => [3000, 999999], + ]; + + $sql = " and (a.price>=? and a.price<=?) "; + $canshu[] = $price_list[$combo_price][0]; + $canshu[] = $price_list[$combo_price][1]; + + } + if (isset($combo_type)) { + $sql = $sql . " and a.type_id=? "; + $canshu[] = $combo_type; + } + if (isset($combo_crowd)) { + $sql = $sql . " and a.crowd_id=? "; + $canshu[] = $combo_crowd; + } + if (isset($combo_sort)) { + if ($combo_sort == 1) { + $sql = $sql . " "; + } + if ($combo_sort == 2) { + $sql = $sql . " "; + } + if ($combo_sort == 3) { + $sql = $sql . " order by a.price"; + } + if ($combo_sort == 4) { + $sql = $sql . " order by a.price desc"; + } + + } + + + $combos = DB::select("select * from combos as a LEFT JOIN ( +select combo_id as c_id,count(*) as count from orders where status in(2,4) group by combo_id +) as b on a.combo_id=b.c_id where a.status=1 and a.sex=?" . $sql, $canshu); + + foreach ($combos as $key => $combo) { + $combo->count=$combo->count?$combo->count:0; + $tags = json_decode($combo->tags, true); + $combo->tags2 = json_decode($combo->tags2, true); + foreach ($tags as $k => $tag) { + $tags[$k] = ['text' => $tag, + 'text_color' => '#47ABD8', + 'color' => '#EBF5FC' + ]; + } + $combo->tag = $tags; + $combo->tag[] = [ + 'text' => $combo->item_count . '个项目', + 'text_color' => '#34C292', + 'color' => '#E9F8F3', + ]; + } + + $hospital_info = $hospital; + + + return \Yz::Return(true, '获取成功', [ + 'list' => $combos, + 'hospital' => $hospital_info + ]); + } +} diff --git a/Laravel/app/Http/Controllers/API/Web/ItemController.php b/Laravel/app/Http/Controllers/API/Web/ItemController.php new file mode 100644 index 0000000..08cbb91 --- /dev/null +++ b/Laravel/app/Http/Controllers/API/Web/ItemController.php @@ -0,0 +1,71 @@ +where(['is_choose'=>1,'status'=>1])->get(); + $search= request('search'); + $list = []; + $group_arr = []; + $group_list = []; + foreach ($items as $item) { + if($item->sex <> $sex and $item->sex<>0){ + continue; + } + $push_type = false; + if ($search == '') { + $push_type = true; + } else { + $check_name = $item->name; + if (strpos($check_name, $search) !== false) { + $push_type = true; + } + + $check_py = $item->pinyin; + if (strpos($check_py, mb_strtoupper($search)) !== false) { + $push_type = true; + } + + $check_group = $item->keshi_name; + if (strpos($check_group, $search) !== false) { + $push_type = true; + } + } + if ($push_type) { + if (!in_array($item->keshi_id, $group_arr)) { + $group_list["科室{$item->keshi_id}"] = [ + 'id' => $item->keshi_id, + 'title' => $item->keshi_name, + 'head_img'=>'/storage/20240822/banner1.png', + 'children' => [], + ]; + $group_arr[] = $item->keshi_id; + } + + $group_list["科室{$item->keshi_id}"]['children'][] = [ + 'id' => $item->item_id, + 'title' => $item->name, + 'price' =>$item->price, + 'original_price'=>$item->original_price, + 'pinyin' => $item->pinyin, + 'desc'=>$item->jianjie + ]; + + + } + + } + return \Yz::Return(true,"查询成功",['list'=>$group_list]); + } +} diff --git a/Laravel/routes/web.php b/Laravel/routes/web.php index 1f1b1fe..10b6896 100644 --- a/Laravel/routes/web.php +++ b/Laravel/routes/web.php @@ -76,5 +76,10 @@ Route::group(['prefix' => 'api/H5'], function () { }); +Route::group(['prefix' => 'api/Web'], function () { + Route::post('/ComboGetList', 'App\Http\Controllers\API\Web\ComboController@GetList');//Web套餐列表 + Route::post('/ItemGetList', 'App\Http\Controllers\API\Web\ItemController@GetList');//Web套餐列表 +}); + //对外------ Route::any('/TJPushInfo', 'App\Http\Controllers\API\Internal\SiXinPushController@PushInfo');//接收思信推送