|
@@ -354,6 +354,12 @@ class Product extends Controller
|
|
|
$q->where('sampling_start_time', '<=', $Product->sampling_end_time);
|
|
$q->where('sampling_start_time', '<=', $Product->sampling_end_time);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ // 新增记录有完整的时间段,数据库有开始时间结束时间未设置
|
|
|
|
|
+ elseif ($sampling_start_time > 0 && $sampling_end_time > 0) {
|
|
|
|
|
+ $query->where(function ($q) use ($sampling_start_time ) {
|
|
|
|
|
+ $q->where('sampling_start_time', '<=', $sampling_start_time);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
->first();
|
|
->first();
|
|
|
|
|
|
|
@@ -501,6 +507,12 @@ class Product extends Controller
|
|
|
$q->where('sampling_start_time', '<=', $Product->sampling_end_time);
|
|
$q->where('sampling_start_time', '<=', $Product->sampling_end_time);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ // 新增记录有完整的时间段,数据库有开始时间结束时间未设置
|
|
|
|
|
+ elseif ($Product->sampling_start_time > 0 && $Product->sampling_end_time > 0) {
|
|
|
|
|
+ $query->where(function ($q) use ($Product ) {
|
|
|
|
|
+ $q->where('sampling_start_time', '<=', $Product->sampling_start_time);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
->first();
|
|
->first();
|
|
|
|
|
|
|
@@ -625,6 +637,12 @@ class Product extends Controller
|
|
|
$q->where('sampling_start_time', '<=', $Product->sampling_end_time);
|
|
$q->where('sampling_start_time', '<=', $Product->sampling_end_time);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ // 新增记录有完整的时间段,数据库有开始时间结束时间未设置
|
|
|
|
|
+ elseif ($Product->sampling_start_time > 0 && $Product->sampling_end_time > 0) {
|
|
|
|
|
+ $query->where(function ($q) use ($Product ) {
|
|
|
|
|
+ $q->where('sampling_start_time', '<=', $Product->sampling_start_time);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
->first();
|
|
->first();
|
|
|
|
|
|