From 46b52e6ae5ba286bce8776cff1cf285e32cfa5a7 Mon Sep 17 00:00:00 2001 From: ztt <835303992@qq.com> Date: Sat, 16 Mar 2024 16:06:05 +0800 Subject: [PATCH] 1 --- addons/shopro/controller/Category.php | 14 ++++++++++++++ addons/shopro/controller/order/Order.php | 3 +++ 2 files changed, 17 insertions(+) diff --git a/addons/shopro/controller/Category.php b/addons/shopro/controller/Category.php index e581b18..1509a0f 100755 --- a/addons/shopro/controller/Category.php +++ b/addons/shopro/controller/Category.php @@ -3,6 +3,7 @@ namespace addons\shopro\controller; use app\admin\model\shopro\Category as CategoryModel; +use app\admin\model\shopro\goods\Goods; class Category extends Common { @@ -28,4 +29,17 @@ class Category extends Common $this->success('商城分类', $categories); } + + /** + * 商城列表 + * @return + */ + public function goodsList() { + $category = CategoryModel::where('parent_id', 0)->normal()->order('weigh', 'desc')->order('id', 'desc')->select(); + foreach ($category as &$item) { + $item['goods_list'] = Goods::where('category_ids', 'in', $item['id'])->show()->select(); + } + + $this->success('商城分类', $category); + } } diff --git a/addons/shopro/controller/order/Order.php b/addons/shopro/controller/order/Order.php index 3ca15ca..f48cfbb 100755 --- a/addons/shopro/controller/order/Order.php +++ b/addons/shopro/controller/order/Order.php @@ -37,6 +37,9 @@ class Order extends Common case 'nocomment': $orders = $orders->paid()->nocomment(); break; + case 'completed': + $orders = $orders->paid()->completed(); + break; } $orders = $orders->order('id', 'desc')->paginate(request()->param('list_rows', 10))->toArray();