Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ptibogxiv committed Nov 5, 2024
1 parent d9a14bf commit 393df28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dashboard/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ function dolishop_display($content) {
$date = new DateTime();
$date->modify('NOW');
$lastdate = $date->format('Y-m-d');
$request = "/discountprice?sortfield=t.".$field."&sortorder=".$order."&limit=".$limit."&page=".$page."&pagination_data=true&sqlfilters=(t.date_begin%3A%3E%3D%3A'".$lastdate."')and(t.date_end%3A%3C%3D%3A'".$lastdate."')and(d.tosell:=:1)";
$request = "/discountprice?sortfield=t.".$field."&sortorder=".$order."&limit=".$limit."&page=".$page."&pagination_data=true&sqlfilters=(t.date_begin%3A%3C%3D%3A'".$lastdate."')and(t.date_end%3A%3E%3D%3A'".$lastdate."')and(d.tosell:=:1)";
$object = callDoliApi("GET", $request, null, dolidelay('product', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null)));
} elseif (!isset($_GET["category"]) || isset($_GET["category"]) && $_GET["category"] == 'all') {
$request = "/products?sortfield=t.".$field."&sortorder=".$order."&limit=".$limit."&page=".$page."&category=".esc_attr($shop)."&pagination_data=true&sqlfilters=(t.tosell:=:1)";
Expand Down
4 changes: 2 additions & 2 deletions functions/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,11 @@ public function widget( $args, $instance ) {
$date->modify('NOW');
$lastdate = $date->format('Y-m-d');
if ( doliversion('19.0.0') ) {
$requestp = "/discountprice?sortfield=t.".$field."&sortorder=".$order."&limit=".$limit."&page=".$page."&pagination_data=true&sqlfilters=(t.date_begin%3A%3E%3D%3A'".$lastdate."')and(t.date_end%3A%3C%3D%3A'".$lastdate."')and(d.tosell:=:1)";
$requestp = "/discountprice?sortfield=t.".$field."&sortorder=".$order."&limit=".$limit."&page=".$page."&pagination_data=true&sqlfilters=(t.date_begin%3A%3C%3D%3A'".$lastdate."')and(t.date_end%3A%3E%3D%3A'".$lastdate."')and(d.tosell:=:1)";
$listproduct = callDoliApi("GET", $requestp, null, dolidelay('product', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null)));
$count = $listproduct->pagination->total;
} else {
$requestp = "/discountprice?sortfield=t.rowid&sortorder=DESC&sqlfilters=(t.date_begin%3A%3E%3D%3A'".$lastdate."')and(t.date_end%3A%3C%3D%3A'".$lastdate."')and(d.tosell:=:1)";
$requestp = "/discountprice?sortfield=t.rowid&sortorder=DESC&sqlfilters=(t.date_begin%3A%3C%3D%3A'".$lastdate."')and(t.date_end%3A%3E%3D%3A'".$lastdate."')and(d.tosell:=:1)";
$listproduct = callDoliApi("GET", $requestp, null, dolidelay('product', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null)));
if (empty($listproduct) || isset($listproduct->error)) {
$count = 0;
Expand Down

0 comments on commit 393df28

Please sign in to comment.