Fixed PreorderProductPrice time ranges
This commit is contained in:
@@ -129,7 +129,7 @@ class PreorderProduct extends mfBaseModel {
|
|||||||
"campaign_id" => $campaign_id,
|
"campaign_id" => $campaign_id,
|
||||||
"preorderproduct_id" => $this->id,
|
"preorderproduct_id" => $this->id,
|
||||||
"start_date<=" => $date,
|
"start_date<=" => $date,
|
||||||
"end_date>" => $date,
|
"end_date>=" => $date,
|
||||||
], "start_date DESC, end_date ASC, `create` DESC");
|
], "start_date DESC, end_date ASC, `create` DESC");
|
||||||
|
|
||||||
if(!$price) {
|
if(!$price) {
|
||||||
@@ -229,7 +229,7 @@ class PreorderProduct extends mfBaseModel {
|
|||||||
"campaign_id" => null,
|
"campaign_id" => null,
|
||||||
"preorderproduct_id" => $this->id,
|
"preorderproduct_id" => $this->id,
|
||||||
"start_date<=" => date($this->today_date),
|
"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");
|
], "start_date DESC, end_date ASC, `create` DESC");
|
||||||
if(!$price) {
|
if(!$price) {
|
||||||
$price = PreorderProductPrice::getFirst([
|
$price = PreorderProductPrice::getFirst([
|
||||||
@@ -324,7 +324,7 @@ class PreorderProduct extends mfBaseModel {
|
|||||||
"campaign_id" => $this->filter_campaign_id,
|
"campaign_id" => $this->filter_campaign_id,
|
||||||
"preorderproduct_id" => $this->id,
|
"preorderproduct_id" => $this->id,
|
||||||
"start_date>=" => null,
|
"start_date>=" => null,
|
||||||
"end_date>" => null,
|
"end_date>=" => null,
|
||||||
], "`create` ASC");
|
], "`create` ASC");
|
||||||
if(!$price) {
|
if(!$price) {
|
||||||
$price = PreorderProductPrice::getFirst([
|
$price = PreorderProductPrice::getFirst([
|
||||||
@@ -332,8 +332,8 @@ class PreorderProduct extends mfBaseModel {
|
|||||||
"netoperator_id" => $this->filter_netoperator_id,
|
"netoperator_id" => $this->filter_netoperator_id,
|
||||||
"campaign_id" => null,
|
"campaign_id" => null,
|
||||||
"preorderproduct_id" => $this->id,
|
"preorderproduct_id" => $this->id,
|
||||||
"start_date>=" => null,
|
"start_date" => null,
|
||||||
"end_date>" => null,
|
"end_date" => null,
|
||||||
], "`create` ASC");
|
], "`create` ASC");
|
||||||
}
|
}
|
||||||
if(!$price) {
|
if(!$price) {
|
||||||
@@ -342,8 +342,8 @@ class PreorderProduct extends mfBaseModel {
|
|||||||
"netoperator_id" => null,
|
"netoperator_id" => null,
|
||||||
"campaign_id" => null,
|
"campaign_id" => null,
|
||||||
"preorderproduct_id" => $this->id,
|
"preorderproduct_id" => $this->id,
|
||||||
"start_date>=" => null,
|
"start_date" => null,
|
||||||
"end_date>" => null,
|
"end_date" => null,
|
||||||
], "`create` ASC");
|
], "`create` ASC");
|
||||||
}
|
}
|
||||||
if($price) {
|
if($price) {
|
||||||
@@ -363,7 +363,7 @@ class PreorderProduct extends mfBaseModel {
|
|||||||
"campaign_id" => $this->filter_campaign_id,
|
"campaign_id" => $this->filter_campaign_id,
|
||||||
"preorderproduct_id" => $this->id,
|
"preorderproduct_id" => $this->id,
|
||||||
"start_date<=" => date($this->today_date),
|
"start_date<=" => date($this->today_date),
|
||||||
"end_date>" => null,
|
"end_date" => null,
|
||||||
], "`create` ASC");
|
], "`create` ASC");
|
||||||
|
|
||||||
if($price) {
|
if($price) {
|
||||||
@@ -385,7 +385,7 @@ class PreorderProduct extends mfBaseModel {
|
|||||||
"campaign_id" => $this->filter_campaign_id,
|
"campaign_id" => $this->filter_campaign_id,
|
||||||
"preorderproduct_id" => $this->id,
|
"preorderproduct_id" => $this->id,
|
||||||
"start_date<=" => date($this->today_date),
|
"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");
|
], "start_date DESC, end_date ASC, `create` DESC");
|
||||||
|
|
||||||
if(!$price) {
|
if(!$price) {
|
||||||
@@ -417,7 +417,7 @@ class PreorderProduct extends mfBaseModel {
|
|||||||
"campaign_id" => null,
|
"campaign_id" => null,
|
||||||
"preorderproduct_id" => $this->id,
|
"preorderproduct_id" => $this->id,
|
||||||
"start_date<=" => date($this->today_date),
|
"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");
|
], "start_date DESC, end_date ASC, `create` DESC");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user