diff --git a/.env.example b/.env.example index 731bbe0a..3f90b95a 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,7 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost +APP_TIMEZONE=RPC LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null @@ -54,4 +55,4 @@ MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" # 前端热更新, PROXY: vhost or path, HOST: 多设备实时 MIX_PROXY=beikeshop.test -MIX_HOST=192.168.0.122 \ No newline at end of file +MIX_HOST=192.168.0.122 diff --git a/beike/Admin/Http/Controllers/PagesController.php b/beike/Admin/Http/Controllers/PagesController.php index cac1b7f5..1d912589 100644 --- a/beike/Admin/Http/Controllers/PagesController.php +++ b/beike/Admin/Http/Controllers/PagesController.php @@ -97,12 +97,12 @@ class PagesController * * @param Request $request * @param int $pageId - * @return RedirectResponse + * @return array */ - public function destroy(Request $request, int $pageId) + public function destroy(Request $request, int $pageId): array { PageRepo::deleteById($pageId); - return redirect()->to(admin_route('pages.index')); + return json_success(trans('common.deleted_success')); } diff --git a/beike/Admin/Http/Resources/CustomerResource.php b/beike/Admin/Http/Resources/CustomerResource.php index 6cc1ddbe..479a7bf1 100644 --- a/beike/Admin/Http/Resources/CustomerResource.php +++ b/beike/Admin/Http/Resources/CustomerResource.php @@ -18,7 +18,7 @@ class CustomerResource extends JsonResource 'id' => $this->id, 'name' => $this->name, 'email' => $this->email, - 'status' => $this->status ? '启用' : '禁用', + 'status' => $this->status, 'avatar' => image_resize($this->avatar), 'from' => $this->from, 'customer_group_name' => $this->customerGroup->description->name ?? '', diff --git a/beike/Repositories/OrderRepo.php b/beike/Repositories/OrderRepo.php index 066cfb88..60bc1916 100644 --- a/beike/Repositories/OrderRepo.php +++ b/beike/Repositories/OrderRepo.php @@ -93,6 +93,12 @@ class OrderRepo $builder->where('created_at', '<', $end); } + $status = $filters['status'] ?? ''; + if ($status) { + $builder->where('status', $status); + } + + return $builder; } diff --git a/beike/Shop/Http/Controllers/Account/OrderController.php b/beike/Shop/Http/Controllers/Account/OrderController.php index 3969c274..5451b4b5 100644 --- a/beike/Shop/Http/Controllers/Account/OrderController.php +++ b/beike/Shop/Http/Controllers/Account/OrderController.php @@ -30,7 +30,11 @@ class OrderController extends Controller */ public function index(Request $request): View { - $orders = OrderRepo::getListByCustomer(current_customer()); + $filters = [ + 'customer' => current_customer(), + 'status' => $request->get('status') + ]; + $orders = OrderRepo::filterOrders($filters); $data = [ 'orders' => OrderList::collection($orders), ]; diff --git a/config/app.php b/config/app.php index 517967c8..c7c8618b 100644 --- a/config/app.php +++ b/config/app.php @@ -39,7 +39,7 @@ return [ | */ - 'debug' => (bool) env('APP_DEBUG', false), + 'debug' => (bool)env('APP_DEBUG', false), /* |-------------------------------------------------------------------------- @@ -67,7 +67,7 @@ return [ | */ - 'timezone' => 'UTC', + 'timezone' => env('APP_TIMEZONE', 'UTC'), /* |-------------------------------------------------------------------------- diff --git a/resources/beike/admin/views/pages/customers/form.blade.php b/resources/beike/admin/views/pages/customers/form.blade.php index 4e946271..282140d6 100644 --- a/resources/beike/admin/views/pages/customers/form.blade.php +++ b/resources/beike/admin/views/pages/customers/form.blade.php @@ -101,8 +101,8 @@
{{ __('shop/login.already') }}
-Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis + {{--
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit - amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
+ amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. --}}{{ __('shop/login.not_already') }}
-With registration with us new world of fashion, fantastic discounts and much more opens to + {{--
With registration with us new world of fashion, fantastic discounts and much more opens to you! The whole process will not take you more than a minute!
If you have any questions, please feel free to contact us, our - customer service center is working for you 24/7.
+ customer service center is working for you 24/7. --}}