1234567891011121314151617181920212223 |
- <?php
- namespace app\api\controller\store;
- use app\admin\model\store\StoreCate;
- use app\models\store\StoreCategory;
- use app\Request;
- class CategoryController
- {
- public function category(Request $request)
- {
- $cateogry = StoreCategory::with('children')->where('is_show', 1)->order('sort desc,id desc')->where('pid', 0)->select();
- return app('json')->success($cateogry->hidden(['add_time', 'is_show', 'sort', 'children.sort', 'children.add_time', 'children.pid', 'children.is_show'])->toArray());
- }
- public function store_cate(Request $request)
- {
- $cate = StoreCate::where('is_show', 1)->order('sort desc,id desc')->where('pid', 0)->select()->toArray();
- return app('json')->success($cate);
- }
- }
|