套餐列表 根据体检类型筛选

wenjuan
yanzai 1 year ago
parent 89f3438cfb
commit 77b20f6e18

@ -44,6 +44,7 @@ class ComboController extends Controller
$combo_crowd = $request->post('combo_crowd'); $combo_crowd = $request->post('combo_crowd');
$combo_price = $request->post('combo_price'); $combo_price = $request->post('combo_price');
$combo_item = $request->post('combo_item'); $combo_item = $request->post('combo_item');
$checkup_type_id = $request->post('checkup_type_id');
$hospital = DB::table('hospitals')->select('id', 'name', 'address', 'latitude', 'longitude')->where(['id' => $hospital])->first(); $hospital = DB::table('hospitals')->select('id', 'name', 'address', 'latitude', 'longitude')->where(['id' => $hospital])->first();
$user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first(); $user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
@ -69,6 +70,10 @@ class ComboController extends Controller
$canshu[] = $price_list[$combo_price][1]; $canshu[] = $price_list[$combo_price][1];
} }
if(isset($checkup_type_id)){
$sql = $sql . " and a.checkup_type_id=? ";
$canshu[] = $checkup_type_id;
}
if (isset($combo_type)) { if (isset($combo_type)) {
$sql = $sql . " and a.type_id=? "; $sql = $sql . " and a.type_id=? ";
$canshu[] = $combo_type; $canshu[] = $combo_type;
@ -94,9 +99,10 @@ class ComboController extends Controller
} }
$combos = DB::select("select * from combos as a LEFT JOIN ( $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 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); ) as b on a.combo_id=b.c_id where a.status=1 and a.sex in(?,0)" . $sql, $canshu);
foreach ($combos as $key => $combo) { foreach ($combos as $key => $combo) {
$combo->count=$combo->count?$combo->count:0; $combo->count=$combo->count?$combo->count:0;

@ -159,9 +159,18 @@ const getComboList = async () => {
doctor: $store.save.doctor, doctor: $store.save.doctor,
hospital: hospital_active.value, hospital: hospital_active.value,
}; };
if($store.getCheckupTypeId()){
let b=$store.getCheckupTypeId()
console.log();
if( Object.keys(b).length != 0){
screenObj.value.checkup_type_id=b.id
}
}
if (screenObj.value) { if (screenObj.value) {
obj = Object.assign(obj, screenObj.value); obj = Object.assign(obj, screenObj.value);
} }
const response = await $api("ComboList", obj); const response = await $api("ComboList", obj);
uni.hideLoading(); uni.hideLoading();
$response(response, () => { $response(response, () => {
@ -311,7 +320,7 @@ const toRouter = () => {
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="relative z-999 pt-10rpx center"> <view class="relative z-999 pt-10rpx center">
<view class="doctor_wrapper"> <view class="doctor_wrapper">
<view class="doctor_tip_wrapper"> <view class="doctor_tip_wrapper">
<text v-if="!!combo_list.doctor.id"></text> <text v-if="!!combo_list.doctor.id"></text>
@ -322,7 +331,7 @@ const toRouter = () => {
</view> </view>
<view class="doctor_tip_wrapper">自动筛选匹配套餐</view> <view class="doctor_tip_wrapper">自动筛选匹配套餐</view>
</view> </view>
</view> --> </view>
<view class="select_wrapper flex" v-if="selectKey"> <view class="select_wrapper flex" v-if="selectKey">
<template v-for="(value, key, index) in combo_select" :key="index"> <template v-for="(value, key, index) in combo_select" :key="index">
<view <view
@ -416,7 +425,7 @@ const toRouter = () => {
</view> </view>
</view> </view>
<uni-popup ref="popup" mask-background-color="transparent"> <uni-popup ref="popup" mask-background-color="transparent">
<view class="pt-180rpx w-full h-100vh" @click="popup.close()"> <view class="pt-260rpx w-full h-100vh" @click="popup.close()">
<view class="bg-[rgba(0,0,0,0.3)] h-100%"> <view class="bg-[rgba(0,0,0,0.3)] h-100%">
<view <view
class="bg-#fff" class="bg-#fff"

@ -208,6 +208,7 @@
getLong() getLong()
} }
getUserInfo() getUserInfo()
$store.setCheckupTypeId({});
}) })
</script> </script>
<template> <template>

Loading…
Cancel
Save