下架商品处理
This commit is contained in:
parent
0fecf2a4b6
commit
361e352c5e
|
|
@ -3,11 +3,10 @@
|
|||
namespace Beike\Shop\Http\Controllers;
|
||||
|
||||
use Beike\Models\Product;
|
||||
use Beike\Shop\Http\Resources\ProductSimple;
|
||||
use Illuminate\Http\Request;
|
||||
use Beike\Repositories\ProductRepo;
|
||||
use Beike\Shop\Http\Resources\ProductSimple;
|
||||
use Beike\Shop\Http\Resources\ProductDetail;
|
||||
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
|
||||
|
||||
class ProductController extends Controller
|
||||
{
|
||||
|
|
@ -21,7 +20,11 @@ class ProductController extends Controller
|
|||
{
|
||||
$product = ProductRepo::getProductDetail($product);
|
||||
if ($product->active == 0) {
|
||||
return redirect(shop_route('home.index'));
|
||||
$data = [
|
||||
'product' => (new ProductDetail($product))->jsonSerialize(),
|
||||
'error' => trans('product.has_been_inactive')
|
||||
];
|
||||
return view('product', $data);
|
||||
}
|
||||
$data = [
|
||||
'product' => (new ProductDetail($product))->jsonSerialize(),
|
||||
|
|
|
|||
|
|
@ -21,4 +21,5 @@ return [
|
|||
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'has_been_inactive' => 'The product has been inactive',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -21,4 +21,5 @@ return [
|
|||
|
||||
'active' => '上架',
|
||||
'inactive' => '下架',
|
||||
'has_been_inactive' => '该商品已下架',
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue