From 77b20f6e18e7281fd51c04467e5da11551bca48f Mon Sep 17 00:00:00 2001 From: yanzai Date: Mon, 7 Oct 2024 22:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E5=88=97=E8=A1=A8=20?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BD=93=E6=A3=80=E7=B1=BB=E5=9E=8B=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/API/H5/ComboController.php | 8 +++++++- h5/pages/main/combo/combo.vue | 15 ++++++++++++--- h5/pages/main/index/index.vue | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index 31a6f9f..e91efd0 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -44,6 +44,7 @@ class ComboController extends Controller $combo_crowd = $request->post('combo_crowd'); $combo_price = $request->post('combo_price'); $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(); $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]; } + if(isset($checkup_type_id)){ + $sql = $sql . " and a.checkup_type_id=? "; + $canshu[] = $checkup_type_id; + } if (isset($combo_type)) { $sql = $sql . " and a.type_id=? "; $canshu[] = $combo_type; @@ -94,9 +99,10 @@ class ComboController extends Controller } + $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); +) 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) { $combo->count=$combo->count?$combo->count:0; diff --git a/h5/pages/main/combo/combo.vue b/h5/pages/main/combo/combo.vue index 8c948f4..866a760 100644 --- a/h5/pages/main/combo/combo.vue +++ b/h5/pages/main/combo/combo.vue @@ -159,9 +159,18 @@ const getComboList = async () => { doctor: $store.save.doctor, 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) { obj = Object.assign(obj, screenObj.value); } + + const response = await $api("ComboList", obj); uni.hideLoading(); $response(response, () => { @@ -311,7 +320,7 @@ const toRouter = () => { - +