public function productDetail($id) { $title_product = 'レンタルサービス'; $product = SellProduct::getSellProById($id); $catSell = CategoryProduct::getCatSell(); $lps = SellProduct::getListPro(); return view('frontend.product.detail', compact('product', 'title_product', 'catSell', 'lps')); }
public function index() { //rental top page $catRenTop = CategoryRental::topCatRental(); $rentalTop = DB::table('rental_product')->rightJoin('top_page_show', 'rental_product.id', '=', 'top_page_show.rental_product_id')->leftJoin('category_rental', 'rental_product.cat_rental_id', '=', 'category_rental.id')->select('rental_product.*', 'category_rental.name')->where('rental_product.is_deleted', '=', NO_DELLETE)->where('rental_product.display', '=', 1)->where('rental_product.display_top', '=', 1)->where('top_page_show.is_deleted', '=', NO_DELLETE)->orderBy('rental_product.order', 'ASC')->limit(TOP_PAGE_NUMBER)->get(); //product top page $catSellTop = CategoryProduct::topCatSell(); $prTop = DB::table('sell_product')->rightJoin('top_page_show', 'sell_product.id', '=', 'top_page_show.sell_product_id')->leftJoin('category_product', 'sell_product.cat_product_id', '=', 'category_product.id')->select('sell_product.*', 'category_product.name')->where('sell_product.is_deleted', '=', NO_DELLETE)->where('sell_product.display', '=', 1)->where('sell_product.display_top', '=', 1)->where('top_page_show.is_deleted', '=', NO_DELLETE)->orderBy('sell_product.order', 'ASC')->limit(TOP_PAGE_NUMBER)->get(); $lrs = RentalProduct::getListRental(); $lps = SellProduct::getListPro(); return view('frontend.homepage', compact('catRenTop', 'catSellTop', 'rentalTop', 'prTop', 'lrs', 'lps')); }
public function getOsusume() { //list sell product $lsp = SellProduct::getAllSellPro(); return view('admin.sell.osusume', compact('lsp')); }
public function delCatSell($id) { $chk = SellProduct::chkCatActive($id); if ($chk == true) { DB::table('category_product')->where('id', '=', $id)->update(array('is_deleted' => INACTIVE)); Session::flash('success', '削除が完了しました。'); return Redirect::route('admin.category.sell.list'); } else { Session::flash('error', 'このカテゴリは削除できません。'); return Redirect::route('admin.category.sell.list'); } }