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();