/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $admin = Auth::user(); $comments = Comment::with('good', 'user')->find($id); if (!$comments->good) { unset($comments->good); $goods = Good::onlyTrashed()->find($comments->good_id); $comments["good"] = $goods; } return view('admin.comments.show', ['comments' => $comments, 'admin' => $admin]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $order = Order::with('address', 'express', 'user', 'order_goods.good')->find($id); foreach ($order->order_goods as $k => $v) { if (!$v->good) { unset($v->good); $goods = Good::onlyTrashed()->find($v->good_id); $order->order_goods["{$k}"]["good"] = $goods; } } $order_status = config('wyshop.order_status'); return view('admin.order.edit', ['order' => $order, 'order_status' => $order_status]); }
public function trash() { $goods = Good::onlyTrashed()->paginate(config('wyshop.page_size')); return view('admin.good.trash', ['goods' => $goods, '_trash' => 'am-active', '_goods' => '']); }
public function trash() { $goods = Good::onlyTrashed()->paginate(config('wyshop.page_size')); // return $goods; return view('admin.good.trash', ['goods' => $goods]); }