Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
yushine committed Jan 2, 2025
1 parent 0fcdb4a commit caad6be
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions innopacks/common/src/Repositories/OrderRepo.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,34 @@

namespace InnoShop\Common\Repositories;

use Exception;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Database\Eloquent\Builder;
use InnoShop\Common\Models\Address;
use InnoShop\Common\Models\Customer;
use InnoShop\Common\Models\Order;
use InnoShop\Common\Resources\AddressListItem;
use InnoShop\Common\Services\StateMachineService;
use Throwable;

class OrderRepo extends BaseRepo
{
/**
* @return array[]
* @throws Exception
*/
public static function getCriteria(): array
{
$statuses = \InnoShop\Common\Services\StateMachineService::getAllStatuses();
$statuses = StateMachineService::getAllStatuses();

return [
['name' => 'number', 'type' => 'input', 'label' => trans('panel/order.number')],
['name' => 'customer_name', 'type' => 'input', 'label' => trans('panel/order.customer_name')],
['name' => 'email', 'type' => 'input', 'label' => trans('panel/order.email')],
['name' => 'telephone', 'type' => 'input', 'label' => trans('panel/order.telephone')],
['name' => 'shipping_method_name', 'type' => 'input', 'label' => trans('panel/order.shipping_method_name')],
['name' => 'billing_method_name', 'type' => 'input', 'label' => trans('panel/order.billing_method_name')],
['name' => 'status', 'type' => 'select', 'label' => trans('panel/order.status'), 'options' => $statuses, 'options_key'=>'status', 'options_label' => 'name'],
['name' => 'status', 'type' => 'select', 'label' => trans('panel/order.status'), 'options' => $statuses, 'options_key' => 'status', 'options_label' => 'name'],
['name' => 'total', 'type' => 'range', 'label' => trans('panel/order.total'),
'start' => ['name' => 'start'],
'end' => ['name' => 'end'],
Expand Down Expand Up @@ -146,9 +150,9 @@ public function builder(array $filters = []): Builder
/**
* @param $data
* @return mixed
* @throws \Throwable
* @throws Throwable
*/
public function create($data): mixed
public function create($data): Order
{
$data = $this->handleData($data);
$order = new Order($data);
Expand Down

0 comments on commit caad6be

Please sign in to comment.