Fixed PreorderProductPrice time ranges

This commit is contained in:
Frank Schubert
2025-09-03 16:49:35 +02:00
parent 242efd32b0
commit 31eee76a05

View File

@@ -129,7 +129,7 @@ class PreorderProduct extends mfBaseModel {
"campaign_id" => $campaign_id,
"preorderproduct_id" => $this->id,
"start_date<=" => $date,
"end_date>" => $date,
"end_date>=" => $date,
], "start_date DESC, end_date ASC, `create` DESC");
if(!$price) {
@@ -229,7 +229,7 @@ class PreorderProduct extends mfBaseModel {
"campaign_id" => null,
"preorderproduct_id" => $this->id,
"start_date<=" => date($this->today_date),
"end_date>" => date($this->today_date),
"end_date>=" => date($this->today_date),
], "start_date DESC, end_date ASC, `create` DESC");
if(!$price) {
$price = PreorderProductPrice::getFirst([
@@ -324,7 +324,7 @@ class PreorderProduct extends mfBaseModel {
"campaign_id" => $this->filter_campaign_id,
"preorderproduct_id" => $this->id,
"start_date>=" => null,
"end_date>" => null,
"end_date>=" => null,
], "`create` ASC");
if(!$price) {
$price = PreorderProductPrice::getFirst([
@@ -332,8 +332,8 @@ class PreorderProduct extends mfBaseModel {
"netoperator_id" => $this->filter_netoperator_id,
"campaign_id" => null,
"preorderproduct_id" => $this->id,
"start_date>=" => null,
"end_date>" => null,
"start_date" => null,
"end_date" => null,
], "`create` ASC");
}
if(!$price) {
@@ -342,8 +342,8 @@ class PreorderProduct extends mfBaseModel {
"netoperator_id" => null,
"campaign_id" => null,
"preorderproduct_id" => $this->id,
"start_date>=" => null,
"end_date>" => null,
"start_date" => null,
"end_date" => null,
], "`create` ASC");
}
if($price) {
@@ -363,7 +363,7 @@ class PreorderProduct extends mfBaseModel {
"campaign_id" => $this->filter_campaign_id,
"preorderproduct_id" => $this->id,
"start_date<=" => date($this->today_date),
"end_date>" => null,
"end_date" => null,
], "`create` ASC");
if($price) {
@@ -385,7 +385,7 @@ class PreorderProduct extends mfBaseModel {
"campaign_id" => $this->filter_campaign_id,
"preorderproduct_id" => $this->id,
"start_date<=" => date($this->today_date),
"end_date>" => date($this->today_date),
"end_date>=" => date($this->today_date),
], "start_date DESC, end_date ASC, `create` DESC");
if(!$price) {
@@ -417,7 +417,7 @@ class PreorderProduct extends mfBaseModel {
"campaign_id" => null,
"preorderproduct_id" => $this->id,
"start_date<=" => date($this->today_date),
"end_date>" => date($this->today_date),
"end_date>=" => date($this->today_date),
], "start_date DESC, end_date ASC, `create` DESC");
}