wip
This commit is contained in:
parent
63181c5acd
commit
2ccc43163c
|
|
@ -17,21 +17,21 @@ class ProductController extends Controller
|
|||
|
||||
public function index(Request $request)
|
||||
{
|
||||
// $product = ProductRepo::list($request->all());
|
||||
$product = ProductRepo::list($request->all());
|
||||
// if ($request->expectsJson()) {
|
||||
// return ProductResource::collection($products);
|
||||
// }
|
||||
|
||||
// dd($product->getItems());
|
||||
// dd(ProductResource::collection($productitem));
|
||||
// dd(ProductResource::collection($product)->jsonSerialize());
|
||||
$data = [
|
||||
'categories' => CategoryRepo::flatten(locale()),
|
||||
'product' => $product,
|
||||
'product' => ProductResource::collection($product),
|
||||
];
|
||||
|
||||
if ($request->expectsJson()) {
|
||||
return ProductResource::collection($product);
|
||||
return json_success('成功', ProductResource::collection($product));
|
||||
return json_success('成功', $product);
|
||||
// return json_success('成功', ProductResource::collection($product));
|
||||
// return json_success('成功', $product);
|
||||
}
|
||||
|
||||
return view('admin::pages.products.index', $data);
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@
|
|||
return url;
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
page: function() {
|
||||
this.loadData();
|
||||
|
|
@ -183,9 +184,8 @@
|
|||
},
|
||||
methods: {
|
||||
loadData: function() {
|
||||
const url = this.url;
|
||||
// window.history.pushState('', '', url);
|
||||
$http.get(url).then((res) => {
|
||||
window.history.pushState('', '', this.url);
|
||||
$http.get(this.url).then((res) => {
|
||||
this.product = res.data;
|
||||
})
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue