套餐限制可用时间段

main
yanzai 12 months ago
parent 61545a7a13
commit 09db2ff0b1

@ -88,6 +88,7 @@ class PlanController extends Controller
$hospital_id =request('hospital'); $hospital_id =request('hospital');
$openid =request('openid'); $openid =request('openid');
$person_id=request('person_id'); $person_id=request('person_id');
$combo_id=request('combo_id');
$date=request('date'); $date=request('date');
$use_type=request('use_type');//使用类型 1个检 2团检 $use_type=request('use_type');//使用类型 1个检 2团检
$checkup_type_id=(string)request('checkup_type_id');//体检类型表对应id $checkup_type_id=(string)request('checkup_type_id');//体检类型表对应id
@ -106,6 +107,12 @@ class PlanController extends Controller
->where('is_vip','<>',1) ->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]); ->whereIn('use_type',[0,$use_type]);
if(!!$combo_id){
$comboInfo=DB::table('combos')->where(['combo_id'=>$combo_id])->first();
if(!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)){
$list=$list->whereBetween('time',[$comboInfo->keyue_start_time,$comboInfo->keyue_end_time]);
}
}
if(!!$personInfo){ if(!!$personInfo){
$list=$list->whereIn('sex',[0,$personInfo->sex]); $list=$list->whereIn('sex',[0,$personInfo->sex]);
} }
@ -139,6 +146,12 @@ class PlanController extends Controller
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0]) ->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
->where('is_vip','<>',1) ->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]); ->whereIn('use_type',[0,$use_type]);
if(!!$combo_id){
$comboInfo=DB::table('combos')->where(['combo_id'=>$combo_id])->first();
if(!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)){
$weeklist=$weeklist->whereBetween('time',[$comboInfo->keyue_start_time,$comboInfo->keyue_end_time]);
}
}
if(!!$personInfo){ if(!!$personInfo){
$weeklist=$weeklist->whereIn('sex',[0,$personInfo->sex]); $weeklist=$weeklist->whereIn('sex',[0,$personInfo->sex]);
} }

@ -200,6 +200,7 @@
obj = { obj = {
hospital: buyInfo.value.hospital, hospital: buyInfo.value.hospital,
person_id: buyInfo.value.person_id, person_id: buyInfo.value.person_id,
combo_id: buyInfo.value.combo_id,
date: currentDate.value, //currentDate.value date: currentDate.value, //currentDate.value
use_type: buyInfo.value.group_id ? 2 : 1, use_type: buyInfo.value.group_id ? 2 : 1,
checkup_type_id: buyInfo.value.group_id ? checkup_type_id: buyInfo.value.group_id ?

Loading…
Cancel
Save