体检类型、套餐类型、套餐适用人群分类、自选项目接口

wenjuan
yanzai 1 year ago
parent d8513c5525
commit 7ed972e95f

@ -49,6 +49,7 @@ class ComboController extends Controller
'id'=>$v['Id'],
'name'=>$v['名称'],
'desc'=>$v['简介'],
'keshi_name'=>$v['科室名称'],
];
}
$item=json_encode($item,JSON_UNESCAPED_UNICODE);
@ -64,6 +65,7 @@ class ComboController extends Controller
'combo_id'=>$combo['Id'],
'sex'=>$sex,
'name'=>$combo['名称'],
'pinyin'=>$combo['拼音'],
'original_price'=>$combo['原价'],
'price'=>$combo['价格'],
'items'=>$item,

@ -15,7 +15,7 @@ class ItemController extends Controller
if(!isset($hospital_id)) return \Yz::echoError1('医院不能为空');
date_default_timezone_set('PRC');
$data=[
"价格下限"=>"0","价格上限"=>"999999","性别"=>null,"妇检"=>false,"套餐Id"=>null,"项目Id列表"=>[],"请求来源"=>"小程序"
"价格下限"=>"0","价格上限"=>"999999","性别"=>null,"妇检"=>false,"套餐Id"=>null
];
$peis=new PEISApiController();
$info= $peis::Post('自选项目查询',$hospital_id,$data,false);
@ -51,7 +51,13 @@ class ItemController extends Controller
'item_id'=>$item['Id'],
'sex'=>$sex,
'name'=>$item['名称'],
'pinyin'=>$item['拼音'],
'price'=>$item['价格'],
'is_choose'=>$item['可选']===false ? "0" : "1",
'keshi_id'=>$item['科室Id'],
'keshi_name'=>$item['科室名称'],
'beizhu'=>$item['备注'],
'jianjie'=>$item['简介'],
'status'=>1,
'updated_at'=>date('Y-m-d H:i:s'),
];

@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class CheckUpTypeController extends Controller
{
//H5获取体检类型名称和logo
public function GetList()
{
$list=DB::table('checkup_type')->where(['status'=>1,'is_del'=>0])->get();
return \Yz::Return(true,"查询完成",['list'=>$list]);
}
}

@ -115,4 +115,17 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group
'info' => $info,
]);
}
//获取套餐类型
public function GetComboType()
{
$type=DB::table('combo_type')->get();
return \Yz::Return(true,"查询成功",['list'=>$type]);
}
//获取套餐适用人群分类
public function GetComboCrowd()
{
$list=DB::table('combo_crowd')->get();
return \Yz::Return(true,"查询成功",['list'=>$list]);
}
}

@ -0,0 +1,64 @@
<?php
namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ItemController extends Controller
{
//获取全部自选项目
public function GetItems()
{
//查询所有可以自选的项目
$items=DB::table('items')->where(['is_choose'=>1,'status'=>1])->get();
$search= request('search');
$list = [];
$group_arr = [];
$group_list = [];
foreach ($items as $item) {
$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,
'children' => [],
];
$group_arr[] = $item->keshi_id;
}
$group_list["科室{$item->keshi_id}"]['children'][] = [
'id' => $item->item_id,
'title' => $item->name,
'price' =>$item->price,
'pinyin' => $item->pinyin,
];
}
}
return \Yz::Return(true,"查询成功",['list'=>$group_list]);
}
}

@ -28,4 +28,10 @@ Route::get('/wxLogin/{env}', function ($env) {
//微信登录授权获取openid
Route::get('/wxGetCode', 'App\Http\Controllers\API\mH5\LoginController@wxGetCode');
Route::get('/test', 'App\Http\Controllers\TestController@DBtest');
Route::any('/payNotify', 'App\Http\Controllers\API\H5\PayController@Notify')->middleware('log');//支付回调
Route::post('/CheckUpTypeGetList', 'App\Http\Controllers\API\H5\CheckUpTypeController@GetList');//获取体检类型分类
Route::post('/GetComboType', 'App\Http\Controllers\API\H5\ComboController@GetComboType');//获取套餐类型
Route::post('/GetComboCrowd', 'App\Http\Controllers\API\H5\ComboController@GetComboCrowd');//获取套餐适用人群分类
Route::post('/GetAllItems', 'App\Http\Controllers\API\H5\ItemController@GetItems');//获取所有自选项目

Loading…
Cancel
Save