调整细节,报告趋势(未完成),医生web套餐、项目
parent
3d992994b3
commit
61c590448c
@ -0,0 +1,97 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\API\Web;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class ComboController extends Controller
|
||||||
|
{
|
||||||
|
//医生端网页打开页面获取套餐列表
|
||||||
|
public function GetList(){
|
||||||
|
$hospital = request('hospital');
|
||||||
|
$sex=request('sex');
|
||||||
|
|
||||||
|
|
||||||
|
$combo_sort = request('combo_sort');
|
||||||
|
$combo_type = request('combo_type');
|
||||||
|
$combo_crowd = request('combo_crowd');
|
||||||
|
$combo_price =request('combo_price');
|
||||||
|
$combo_item = request('combo_item');
|
||||||
|
|
||||||
|
$hospital = DB::table('hospitals')->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
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\API\Web;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class ItemController extends Controller
|
||||||
|
{
|
||||||
|
//医生端网页打开页面获取项目列表
|
||||||
|
public function GetList()
|
||||||
|
{
|
||||||
|
$hospital = request('hospital');
|
||||||
|
$sex=request('sex');
|
||||||
|
//查询所有可以自选的项目
|
||||||
|
$items=DB::table('items')->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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue