ztt 9 months ago
parent fc1c871959
commit 46b52e6ae5
  1. 14
      addons/shopro/controller/Category.php
  2. 3
      addons/shopro/controller/order/Order.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);
}
}

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

Loading…
Cancel
Save