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