|
@@ -138,6 +138,7 @@ class ApiController extends Controller
|
|
$first_day = strtotime($all_time[0]);
|
|
$first_day = strtotime($all_time[0]);
|
|
// DB::enableQueryLog();
|
|
// DB::enableQueryLog();
|
|
$sche_dule = Schedule::whereBetween('schedule_day',[$start_time,$end_time])
|
|
$sche_dule = Schedule::whereBetween('schedule_day',[$start_time,$end_time])
|
|
|
|
+ ->where(['docter_id'=>$docter_id])
|
|
->pluck('id')
|
|
->pluck('id')
|
|
->toArray();
|
|
->toArray();
|
|
// echo '<pre>';
|
|
// echo '<pre>';
|
|
@@ -197,9 +198,17 @@ class ApiController extends Controller
|
|
for ($i = 0; $i<6; $i++){
|
|
for ($i = 0; $i<6; $i++){
|
|
$str_time = date('Y-m-d',($first_day + $i * 86400));
|
|
$str_time = date('Y-m-d',($first_day + $i * 86400));
|
|
for($j=0;$j<3;$j++){
|
|
for($j=0;$j<3;$j++){
|
|
|
|
+
|
|
|
|
+ //dd($sche_dule);
|
|
|
|
+// DB::enableQueryLog();
|
|
|
|
+
|
|
//检测上午
|
|
//检测上午
|
|
$is_mo_have = SchedulePeriod::whereIn('schedule_id',$sche_dule)->where('schedule_date',$str_time)->whereIn('time_period_id',$times[$j])
|
|
$is_mo_have = SchedulePeriod::whereIn('schedule_id',$sche_dule)->where('schedule_date',$str_time)->whereIn('time_period_id',$times[$j])
|
|
->where('docter_id','!=',$docter_id)->count();
|
|
->where('docter_id','!=',$docter_id)->count();
|
|
|
|
+// echo '<pre>';
|
|
|
|
+// print_r(DB::getQueryLog());
|
|
|
|
+// echo '</pre>';
|
|
|
|
+// dd($is_mo_have);
|
|
$is_self = SchedulePeriod::whereIn('schedule_id',$sche_dule)->where('schedule_date',$str_time)->whereIn('time_period_id',$times[$j])
|
|
$is_self = SchedulePeriod::whereIn('schedule_id',$sche_dule)->where('schedule_date',$str_time)->whereIn('time_period_id',$times[$j])
|
|
->where('docter_id',$docter_id)->count();
|
|
->where('docter_id',$docter_id)->count();
|
|
if($is_self){
|
|
if($is_self){
|
|
@@ -218,11 +227,12 @@ class ApiController extends Controller
|
|
for ($i=0; $i<=6; $i++){
|
|
for ($i=0; $i<=6; $i++){
|
|
$str_time = date('Y-m-d',($first_day + $i * 86400));
|
|
$str_time = date('Y-m-d',($first_day + $i * 86400));
|
|
for($j=0;$j<=2;$j++){
|
|
for($j=0;$j<=2;$j++){
|
|
- //检测上午
|
|
|
|
|
|
+
|
|
$is_mo_have = SchedulePeriod::whereIn('schedule_id',$sche_dule)->where('schedule_date',$str_time)->whereIn('time_period_id',$times[$j])
|
|
$is_mo_have = SchedulePeriod::whereIn('schedule_id',$sche_dule)->where('schedule_date',$str_time)->whereIn('time_period_id',$times[$j])
|
|
->where('organization_id','!=',$org_id)->where('docter_id','=',$docter_id)->count();
|
|
->where('organization_id','!=',$org_id)->where('docter_id','=',$docter_id)->count();
|
|
$is_mo_self = SchedulePeriod::whereIn('schedule_id',$sche_dule)->where('schedule_date',$str_time)->whereIn('time_period_id',$times[$j])
|
|
$is_mo_self = SchedulePeriod::whereIn('schedule_id',$sche_dule)->where('schedule_date',$str_time)->whereIn('time_period_id',$times[$j])
|
|
->where('organization_id',$org_id)->where('docter_id',$docter_id)->count();
|
|
->where('organization_id',$org_id)->where('docter_id',$docter_id)->count();
|
|
|
|
+
|
|
if($is_mo_self){
|
|
if($is_mo_self){
|
|
$sche_dule_arr[$j][$week_arr[$i]] = true;
|
|
$sche_dule_arr[$j][$week_arr[$i]] = true;
|
|
}
|
|
}
|