提示调整、web订单隐藏按钮、团检号源绑定调整

main
yanzai 8 months ago
parent 8f9f635df6
commit 1a6e4cfdb1

@ -9,330 +9,339 @@ use Illuminate\Support\Facades\DB;
class PlanController extends Controller class PlanController extends Controller
{ {
//获取本月每日剩余号源数量 //获取本月每日剩余号源数量
public function GetMonthPlanCount() public function GetMonthPlanCount()
{ {
$hospital_id =request('hospital'); $hospital_id = request('hospital');
$openid =request('openid'); $openid = request('openid');
$person_id=request('person_id'); $person_id = request('person_id');
$month=request('month'); $month = request('month');
$use_type=request('use_type');//使用类型 1个检 2团检 $use_type = request('use_type');//使用类型 1个检 2团检
$checkup_type_id=request('checkup_type_id');//体检类型表对应id $checkup_type_id = request('checkup_type_id');//体检类型表对应id
$amount=request('amount');//总金额 $amount = request('amount');//总金额
if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空"); if (!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
$danwei_id=request('danwei_id');//单位id $danwei_id = request('danwei_id');//单位id
$first_day_timestamp = strtotime($month . '-01'); $first_day_timestamp = strtotime($month . '-01');
$first_day = date('Y-m-d', $first_day_timestamp); //当月第一天 $first_day = date('Y-m-d', $first_day_timestamp); //当月第一天
$last_day_timestamp = strtotime($month . '-01 +1 month -1 day'); $last_day_timestamp = strtotime($month . '-01 +1 month -1 day');
$last_day = date('Y-m-d', $last_day_timestamp); //当月最后一天 $last_day = date('Y-m-d', $last_day_timestamp); //当月最后一天
$currentDateTime = now(); $currentDateTime = now();
$list=DB::table('plans') $list = DB::table('plans')
->whereBetween('date',[$first_day,$last_day])->whereIn('status',[1]) ->whereBetween('date', [$first_day, $last_day])->whereIn('status', [1])
->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime]) ->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [json_encode($checkup_type_id)]) ->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [json_encode($checkup_type_id)])
->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]);
->where(function ($query) use ($danwei_id) {
// 检查 bind_work_unit_id 为 NULL 或空字符串 if (!empty($danwei_id)) {
$query->whereNull('bind_work_unit_id') $cha_bind_danwei = DB::table('plan_type')->WhereRaw('JSON_CONTAINS(bind_units, ?)', [json_encode($danwei_id)])->where(['is_del' => 0])->get();
->orWhere('bind_work_unit_id', '=', ''); if (count($cha_bind_danwei) > 0) {
$list = $list->WhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
// 如果 $danwei_id 不为空,则添加额外的条件 } else {
if (!empty($danwei_id)) { $list = $list
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]); ->where(function ($query) use ($danwei_id) {
} // 检查 bind_work_unit_id 为 NULL 或空字符串
}); $query->whereNull('bind_work_unit_id')
->orWhere('bind_work_unit_id', '=', '');
if(isset($person_id)){ });
$personInfo=DB::table('web_user_person')->where(['id'=>$person_id])->first();
if(!!$personInfo){
$list=$list->whereIn('sex',[0,$personInfo->sex]);
}
} }
if ($use_type == 1) { }
$list = $list->where(function ($query) use ($amount) { if (isset($person_id)) {
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount); $personInfo = DB::table('web_user_person')->where(['id' => $person_id])->first();
}); if (!!$personInfo) {
$list = $list->whereIn('sex', [0, $personInfo->sex]);
} }
}
if ($use_type == 1) {
$list = $list->where(function ($query) use ($amount) {
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
});
}
if ($use_type == 2) { if ($use_type == 2) {
$list = $list->where(function ($query) use ($amount) { $list = $list->where(function ($query) use ($amount) {
$query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount); $query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount);
}); });
} }
$list=$list->select('date', DB::raw('COUNT(*) as count')); $list = $list->select('date', DB::raw('COUNT(*) as count'));
$list=$list->groupBy('date')->get(); $list = $list->groupBy('date')->get();
//如果是婚检不是星期二、五、六数量设置为0 //如果是婚检不是星期二、五、六数量设置为0
if ($checkup_type_id == 4) { if ($checkup_type_id == 4) {
$dates = array(); $dates = array();
foreach ($list as $item) { foreach ($list as $item) {
$date = $item->date; $date = $item->date;
$dayOfWeek = date('N', strtotime($date)); $dayOfWeek = date('N', strtotime($date));
if (in_array($dayOfWeek, config('app.globals.HunJianXingQi')) ) { if (in_array($dayOfWeek, config('app.globals.HunJianXingQi'))) {
$dates[] = $item; $dates[] = $item;
}
} }
$list = $dates;
} }
$list = $dates;
}
//获取整月日期 //获取整月日期
// 获取当月的第一天 // 获取当月的第一天
$firstDay = date("Y-m-d", strtotime($month . "-01")); $firstDay = date("Y-m-d", strtotime($month . "-01"));
// 获取当月的最后一天 // 获取当月的最后一天
$lastDay = date("Y-m-t", strtotime($month)); $lastDay = date("Y-m-t", strtotime($month));
$dates = array(); $dates = array();
$k=0; $k = 0;
for ($i = $firstDay; $i <= $lastDay; $i = date("Y-m-d", strtotime($i . " +1 day"))) { for ($i = $firstDay; $i <= $lastDay; $i = date("Y-m-d", strtotime($i . " +1 day"))) {
$xingqi=\App\Lib\Tools::GetWeekName($i); $xingqi = \App\Lib\Tools::GetWeekName($i);
$dates[]=[ $dates[] = [
'date'=>$i, 'date' => $i,
'xingqi'=>$xingqi, 'xingqi' => $xingqi,
'count'=>0 'count' => 0
]; ];
foreach ($list as $item) { foreach ($list as $item) {
if($item->date == $i){ if ($item->date == $i) {
$dates[$k]=[ $dates[$k] = [
'date'=>$i, 'date' => $i,
'xingqi'=>$xingqi, 'xingqi' => $xingqi,
'count'=>$item->count 'count' => $item->count
]; ];
break; break;
} }
}
$k++;
} }
$k++;
return \Yz::Return(true,"查询完成",['list'=>$dates]);
} }
//获取某日号源列表
public function GetDayPlanList()
{
$hospital_id =request('hospital');
$openid =request('openid');
$person_id=request('person_id');
$person_sex=request('person_sex');
$combo_id=request('combo_id');
$item_ids=request('item_ids');
$date=request('date');
$er_xian_info=request('er_xian_info');
$use_type=request('use_type');//使用类型 1个检 2团检
$checkup_type_id=(string)request('checkup_type_id');//体检类型表对应id
$amount=request('amount');//总金额
if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
$danwei_id=request('danwei_id');//单位名称 return \Yz::Return(true, "查询完成", ['list' => $dates]);
}
$personInfo=false; //获取某日号源列表
if(isset($person_id)){ public function GetDayPlanList()
$personInfo=DB::table('web_user_person')->where(['id'=>$person_id])->first(); {
$hospital_id = request('hospital');
$openid = request('openid');
$person_id = request('person_id');
$person_sex = request('person_sex');
$combo_id = request('combo_id');
$item_ids = request('item_ids');
$date = request('date');
$er_xian_info = request('er_xian_info');
$use_type = request('use_type');//使用类型 1个检 2团检
$checkup_type_id = (string)request('checkup_type_id');//体检类型表对应id
$amount = request('amount');//总金额
if (!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
$danwei_id = request('danwei_id');//单位名称
$personInfo = false;
if (isset($person_id)) {
$personInfo = DB::table('web_user_person')->where(['id' => $person_id])->first();
}
$currentDateTime = now();
$list = DB::table('plans')
->where('date', $date)->whereIn('status', [1, 2])
->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
->where(['hospital_id' => $hospital_id, 'type' => 1, 'is_del' => 0])
->where('is_vip', '<>', 1)
->whereIn('use_type', [0, $use_type]);
if (!empty($danwei_id)) {
$cha_bind_danwei = DB::table('plan_type')->WhereRaw('JSON_CONTAINS(bind_units, ?)', [json_encode($danwei_id)])->where(['is_del' => 0])->get();
if (count($cha_bind_danwei) > 0) {
$list = $list->WhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
} else {
$list = $list
->where(function ($query) use ($danwei_id) {
// 检查 bind_work_unit_id 为 NULL 或空字符串
$query->whereNull('bind_work_unit_id')
->orWhere('bind_work_unit_id', '=', '');
});
} }
$currentDateTime = now(); }
$list=DB::table('plans')
->where('date',$date)->whereIn('status',[1,2])
->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")',[$checkup_type_id])
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type])
->where(function ($query) use ($danwei_id) {
// 检查 bind_work_unit_id 为 NULL 或空字符串
$query->whereNull('bind_work_unit_id')
->orWhere('bind_work_unit_id', '=', '');
// 如果 $danwei_id 不为空,则添加额外的条件
if (!empty($danwei_id)) {
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
}
});
$comboItemsNmr=[]; $comboItemsNmr = [];
if(!!$combo_id){ if (!!$combo_id) {
$comboInfo=DB::table('combos')->where(['combo_id'=>$combo_id])->first(); $comboInfo = DB::table('combos')->where(['combo_id' => $combo_id])->first();
if(!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)){ if (!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)) {
$list=$list->whereBetween('time',[$comboInfo->keyue_start_time,$comboInfo->keyue_end_time]); $list = $list->whereBetween('time', [$comboInfo->keyue_start_time, $comboInfo->keyue_end_time]);
}
$comboItemsNmr=DB::table('combo_items')->where(['combo_id'=>$combo_id])->where('name', 'like', '%磁%')->get();
}
$ItemsNmr=[];//自选核磁项目
if(isset($item_ids) and !empty($item_ids)){
$ItemsNmr=DB::table('items')->whereIn('item_id',$item_ids)->where('name', 'like', '%磁%')->get();
}
if(!!$personInfo){
$list=$list->whereIn('sex',[0,$personInfo->sex]);
}
if(isset($person_sex)){
$list=$list->whereIn('sex',[0,$person_sex]);
}
if ($use_type == 1) {
$list = $list->where(function ($query) use ($amount) {
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
});
} }
$comboItemsNmr = DB::table('combo_items')->where(['combo_id' => $combo_id])->where('name', 'like', '%磁%')->get();
}
$ItemsNmr = [];//自选核磁项目
if (isset($item_ids) and !empty($item_ids)) {
$ItemsNmr = DB::table('items')->whereIn('item_id', $item_ids)->where('name', 'like', '%磁%')->get();
}
if (!!$personInfo) {
$list = $list->whereIn('sex', [0, $personInfo->sex]);
}
if (isset($person_sex)) {
$list = $list->whereIn('sex', [0, $person_sex]);
}
if ($use_type == 1) {
$list = $list->where(function ($query) use ($amount) {
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
});
}
if ($use_type == 2) { if ($use_type == 2) {
$list = $list->where(function ($query) use ($amount) { $list = $list->where(function ($query) use ($amount) {
$query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount); $query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount);
}); });
} }
$list=$list->orderBy('time','asc')->get(); $list = $list->orderBy('time', 'asc')->get();
if(count($comboItemsNmr)>0 or count($ItemsNmr)>0 or !empty($er_xian_info)){ if (count($comboItemsNmr) > 0 or count($ItemsNmr) > 0 or !empty($er_xian_info)) {
//如果有核磁项目11点往后的号源不可用 //如果有核磁项目11点往后的号源不可用
foreach ($list as $key=>$item) { foreach ($list as $key => $item) {
if($item->time > '11:00:00' and $item->time <= '12:00:00'){ if ($item->time > '11:00:00' and $item->time <= '12:00:00') {
$list[$key]->status=2; $list[$key]->status = 2;
}
} }
} }
//如果是婚检不是星期二、五、六数量设置为0 }
if ($checkup_type_id == 4) { //如果是婚检不是星期二、五、六数量设置为0
if ($checkup_type_id == 4) {
$dayOfWeek = date('N', strtotime($date));
if(!in_array($dayOfWeek, config('app.globals.HunJianXingQi')) ) {
$list=[];
}
$dayOfWeek = date('N', strtotime($date));
if (!in_array($dayOfWeek, config('app.globals.HunJianXingQi'))) {
$list = [];
} }
// 获取前后各三天的日期
$dateTime = new DateTime($date);
$days7=[];
for ($i = -3; $i <= 3; $i++) {
$dateTimeClone = clone $dateTime; // 克隆对象以避免修改原对象
$dateTimeClone->modify("$i days"); // 修改日期
$days7[] = $dateTimeClone->format('Y-m-d'); // 按照需要的格式添加到结果数组
}
$weeklist=DB::table('plans') }
->whereBetween('date',[$days7[0],$days7[6]])->whereIn('status',[1])
->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type])
->where(function ($query) use ($danwei_id) {
// 检查 bind_work_unit_id 为 NULL 或空字符串
$query->whereNull('bind_work_unit_id')
->orWhere('bind_work_unit_id', '=', '');
// 如果 $danwei_id 不为空,则添加额外的条件 // 获取前后各三天的日期
if (!empty($danwei_id)) { $dateTime = new DateTime($date);
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]); $days7 = [];
} for ($i = -3; $i <= 3; $i++) {
}); $dateTimeClone = clone $dateTime; // 克隆对象以避免修改原对象
$dateTimeClone->modify("$i days"); // 修改日期
$days7[] = $dateTimeClone->format('Y-m-d'); // 按照需要的格式添加到结果数组
}
$weeklist = DB::table('plans')
->whereBetween('date', [$days7[0], $days7[6]])->whereIn('status', [1])
->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
->where(['hospital_id' => $hospital_id, 'type' => 1, 'is_del' => 0])
->where('is_vip', '<>', 1)
->whereIn('use_type', [0, $use_type]);
if (!empty($danwei_id)) {
$cha_bind_danwei = DB::table('plan_type')->WhereRaw('JSON_CONTAINS(bind_units, ?)', [json_encode($danwei_id)])->where(['is_del' => 0])->get();
if (count($cha_bind_danwei) > 0) {
$weeklist = $weeklist->WhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
} else {
$weeklist = $weeklist
->where(function ($query) use ($danwei_id) {
// 检查 bind_work_unit_id 为 NULL 或空字符串
$query->whereNull('bind_work_unit_id')
->orWhere('bind_work_unit_id', '=', '');
});
}
}
if(count($comboItemsNmr)>0 or count($ItemsNmr)>0 or !empty($er_xian_info)){ if (count($comboItemsNmr) > 0 or count($ItemsNmr) > 0 or !empty($er_xian_info)) {
//如果有核磁项目11点往后的号源不可用 //如果有核磁项目11点往后的号源不可用
$weeklist=$weeklist->where('time','<=','11:00'); $weeklist = $weeklist->where('time', '<=', '11:00');
} }
if(!!$combo_id){ if (!!$combo_id) {
$comboInfo=DB::table('combos')->where(['combo_id'=>$combo_id])->first(); $comboInfo = DB::table('combos')->where(['combo_id' => $combo_id])->first();
if(!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)){ if (!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)) {
$weeklist=$weeklist->whereBetween('time',[$comboInfo->keyue_start_time,$comboInfo->keyue_end_time]); $weeklist = $weeklist->whereBetween('time', [$comboInfo->keyue_start_time, $comboInfo->keyue_end_time]);
}
if(count($comboItemsNmr)>0){
$weeklist=$weeklist->whereNotBetween('time',['11:00:00','12:00:00']);
}
} }
if(!!$personInfo){ if (count($comboItemsNmr) > 0) {
$weeklist=$weeklist->whereIn('sex',[0,$personInfo->sex]); $weeklist = $weeklist->whereNotBetween('time', ['11:00:00', '12:00:00']);
} }
}
if (!!$personInfo) {
$weeklist = $weeklist->whereIn('sex', [0, $personInfo->sex]);
}
if ($use_type == 1) { if ($use_type == 1) {
$weeklist = $weeklist->where(function ($query) use ($amount) { $weeklist = $weeklist->where(function ($query) use ($amount) {
$query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount); $query->where('amount_limit1', 0)->orWhere('amount_limit1', '>=', $amount);
}); });
} }
if ($use_type == 2) { if ($use_type == 2) {
$weeklist = $weeklist->where(function ($query) use ($amount) { $weeklist = $weeklist->where(function ($query) use ($amount) {
$query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount); $query->where('amount_limit2', 0)->orWhere('amount_limit2', '>=', $amount);
}); });
} }
$weeklist=$weeklist->select('date', DB::raw('COUNT(*) as count')); $weeklist = $weeklist->select('date', DB::raw('COUNT(*) as count'));
$weeklist=$weeklist->groupBy('date')->get(); $weeklist = $weeklist->groupBy('date')->get();
//如果是婚检不是星期二、五、六数量设置为0 //如果是婚检不是星期二、五、六数量设置为0
if ($checkup_type_id == 4) { if ($checkup_type_id == 4) {
$dates = array(); $dates = array();
foreach ($weeklist as $item) { foreach ($weeklist as $item) {
$date = $item->date; $date = $item->date;
$dayOfWeek = date('N', strtotime($date)); $dayOfWeek = date('N', strtotime($date));
if (in_array($dayOfWeek, config('app.globals.HunJianXingQi')) ) { if (in_array($dayOfWeek, config('app.globals.HunJianXingQi'))) {
$dates[] = $item; $dates[] = $item;
}
} }
$weeklist = $dates;
} }
$week7=[]; $weeklist = $dates;
$k=0; }
foreach ($days7 as $date) { $week7 = [];
$xingqi=\App\Lib\Tools::GetWeekName($date); $k = 0;
$week7[]=[ foreach ($days7 as $date) {
'date'=>$date, $xingqi = \App\Lib\Tools::GetWeekName($date);
'count'=>0, $week7[] = [
'xingqi'=>$xingqi 'date' => $date,
]; 'count' => 0,
foreach ($weeklist as $plan) { 'xingqi' => $xingqi
if($plan->date == $date){ ];
$week7[$k]=[ foreach ($weeklist as $plan) {
'date'=>$date, if ($plan->date == $date) {
'xingqi'=>$xingqi, $week7[$k] = [
'count'=>$plan->count 'date' => $date,
]; 'xingqi' => $xingqi,
break; 'count' => $plan->count
} ];
break;
} }
$k++;
} }
$k++;
}
return \Yz::Return(true,"查询完成",['list'=>$list,'weeklist'=>$week7]); return \Yz::Return(true, "查询完成", ['list' => $list, 'weeklist' => $week7]);
} }
//检查号源是否可用
public function CheckPlan($plan_id,$hospital_id,$type,$sex,$price,$checkup_type_id) //检查号源是否可用
public function CheckPlan($plan_id, $hospital_id, $type, $sex, $price, $checkup_type_id)
{ {
$plan = DB::table('plans')->where(['id' => $plan_id, 'hospital_id' => $hospital_id, 'status' => 1, 'is_del' => 0])->first(); $plan = DB::table('plans')->where(['id' => $plan_id, 'hospital_id' => $hospital_id, 'status' => 1, 'is_del' => 0])->first();
if (!$plan) return ['status'=>false,'msg'=>"号源不可用"]; if (!$plan) return ['status' => false, 'msg' => "号源不可用"];
//判断个检/团检类型 //判断个检/团检类型
if ($plan->use_type <> 0 and $plan->use_type <> $type) { if ($plan->use_type <> 0 and $plan->use_type <> $type) {
$type_temp = ''; $type_temp = '';
if ($plan->use_type == 1) $type_temp = '个检'; if ($plan->use_type == 1) $type_temp = '个检';
if ($plan->use_type == 2) $type_temp = '团检'; if ($plan->use_type == 2) $type_temp = '团检';
return ['status'=>false,'msg'=>"此号源为" . $type_temp . "号源,不可用"]; return ['status' => false, 'msg' => "此号源为" . $type_temp . "号源,不可用"];
} }
//判断是否是预留号源 //判断是否是预留号源
if ($plan->type <> 1) return ['status'=>false,'msg'=>"此号源为预留号源,不可用"]; if ($plan->type <> 1) return ['status' => false, 'msg' => "此号源为预留号源,不可用"];
//判断是否是vip //判断是否是vip
//判断性别 //判断性别
if ($plan->sex <> 0 and $plan->sex <> $sex) return ['status'=>false,'msg'=>"此号源性别与体检人性别不符,不可用"]; if ($plan->sex <> 0 and $plan->sex <> $sex) return ['status' => false, 'msg' => "此号源性别与体检人性别不符,不可用"];
//判断体检类型checkup_type //判断体检类型checkup_type
if(!!$checkup_type_id){ if (!!$checkup_type_id) {
$checkup_type_array=json_decode($plan->checkup_type_id,true); $checkup_type_array = json_decode($plan->checkup_type_id, true);
if(!in_array($checkup_type_id,$checkup_type_array)){ if (!in_array($checkup_type_id, $checkup_type_array)) {
return ['status'=>false,'msg'=>"此号源体检类型与套餐不匹配,不可用"]; return ['status' => false, 'msg' => "此号源体检类型与套餐不匹配,不可用"];
} }
} }
//判断金额 //判断金额
if ($plan->use_type == 1 and $plan->amount_limit1 <> 0) { if ($plan->use_type == 1 and $plan->amount_limit1 <> 0) {
if ($price < $plan->amount_limit1) return ['status'=>false,'msg'=>"未达到此号源限制的金额,不可用"]; if ($price < $plan->amount_limit1) return ['status' => false, 'msg' => "未达到此号源限制的金额,不可用"];
} }
if ($plan->use_type == 2 and $plan->amount_limit2 <> 0) { if ($plan->use_type == 2 and $plan->amount_limit2 <> 0) {
if ($price < $plan->amount_limit2) return ['status'=>false,'msg'=>"未达到此号源限制的金额,不可用"]; if ($price < $plan->amount_limit2) return ['status' => false, 'msg' => "未达到此号源限制的金额,不可用"];
} }
//判断时间是否过期 //判断时间是否过期
$plan_datetime = $plan->date . ' ' . $plan->time; $plan_datetime = $plan->date . ' ' . $plan->time;
if ($plan_datetime < date('Y-m-d H:i:s')) return ['status'=>false,'msg'=>"号源已过期,不可用"]; if ($plan_datetime < date('Y-m-d H:i:s')) return ['status' => false, 'msg' => "号源已过期,不可用"];
return ['status'=>true,'msg'=>"",'plan'=>$plan]; return ['status' => true, 'msg' => "", 'plan' => $plan];
} }
} }

@ -1,7 +1,7 @@
const app_type = 'gzh' const app_type = 'gzh'
//const base_url = "https://api.hainan2024.sa0.online" //开发环境 //const base_url = "https://api.hainan2024.sa0.online" //开发环境
const base_url="https://tj-h5.hnxdfe.com" //正式环境 //const base_url="https://tj-h5.hnxdfe.com" //正式环境
//const base_url="http://124.225.137.54:39081" //测试环境 const base_url="http://124.225.137.54:39081" //测试环境
const config = { const config = {
api_map_url: base_url + '/api/ApiMap/h5', api_map_url: base_url + '/api/ApiMap/h5',
base_assets_url: base_url, base_assets_url: base_url,

@ -139,7 +139,7 @@
<view class="order_info_value_wrapper">¥{{ order_info.true_price }}</view> <view class="order_info_value_wrapper">¥{{ order_info.true_price }}</view>
</view> </view>
</view> </view>
<view @click="toPlan()" class="check_done_wrapper">立即预约体</view> <view v-if="order_info.source !='web'" @click="toPlan()" class="check_done_wrapper"></view>
<view @click="toOrderList()" class="next_done_wrapper"> <view @click="toOrderList()" class="next_done_wrapper">
<view style="margin-right: 6rpx;">下次预约</view> <view style="margin-right: 6rpx;">下次预约</view>
<view style="letter-spacing: -10rpx; vertical-align:super;color: #b3b3b3;"> <view style="letter-spacing: -10rpx; vertical-align:super;color: #b3b3b3;">

@ -108,6 +108,10 @@
style="font-size: 24rpx;padding:20rpx 40rpx; 0rpx 40rpx;color:#FF0000;"> style="font-size: 24rpx;padding:20rpx 40rpx; 0rpx 40rpx;color:#FF0000;">
请您的配偶在15分钟内完成预约否则本次预约将会失效如有支付金额会原路退回 请您的配偶在15分钟内完成预约否则本次预约将会失效如有支付金额会原路退回
</view> </view>
<view v-else
style="font-size: 24rpx;padding:20rpx 40rpx; 0rpx 40rpx;color:#FF0000;text-align: center;">
请提前10分钟到现场自助机取号超时作废
</view>
</view> </view>
<view class="order_info_wrapper"> <view class="order_info_wrapper">
<view class="order_info_title_wrapper">预约信息</view> <view class="order_info_title_wrapper">预约信息</view>

Loading…
Cancel
Save