Simplify count method by inlining variable assignments in goals_criteria_products.
This commit is contained in:
@@ -18,17 +18,12 @@ class goals_criteria_products implements goals_criteria_products_i
|
||||
public function count(goals_criteria $goal): int
|
||||
{
|
||||
$count = 0;
|
||||
$product_ids = $this->listIDs();
|
||||
$department_ids = $goal->departments->listIDs();
|
||||
$customer_numbers = $goal->users->listCustomerNumbers();
|
||||
$datetime_start = $goal->start;
|
||||
$datetime_end = $goal->end;
|
||||
$items = order_items_o::getListByCriteria(
|
||||
department_ids: $department_ids,
|
||||
product_ids: $product_ids,
|
||||
customer_numbers: $customer_numbers,
|
||||
datetime_start: $datetime_start,
|
||||
datetime_end: $datetime_end,
|
||||
department_ids: $goal->departments->listIDs(),
|
||||
product_ids: $this->listIDs(),
|
||||
customer_numbers: $goal->users->listCustomerNumbers(),
|
||||
datetime_start: $goal->start,
|
||||
datetime_end: $goal->end,
|
||||
);
|
||||
foreach ($items as $item) {
|
||||
$count += $item->quantity;
|
||||
|
||||
Reference in New Issue
Block a user