体检类型、套餐类型、套餐适用人群分类、自选项目接口
parent
d8513c5525
commit
7ed972e95f
@ -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]);
|
||||
}
|
||||
}
|
||||
@ -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]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue