本文整理汇总了PHP中app\Comment::getreviewProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::getreviewProduct方法的具体用法?PHP Comment::getreviewProduct怎么用?PHP Comment::getreviewProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Comment
的用法示例。
在下文中一共展示了Comment::getreviewProduct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: detail
public function detail($id)
{
$product = Product::find($id);
$rel = new Product();
$img = Image::getImage($id);
$color = Color::all();
$size = Size::all();
$mapColor = MapColor::getColor($id);
$mapSize = MapSize::getSize($id);
$cat = category::all();
$rateAvg = Comment::getAvg($id);
$count = Comment::getCount($id);
$review = Comment::getreviewProduct($id);
$relative = $rel->getRelative($product->category_id, $id);
$obj = new category();
// navbar
$nav = new category();
$menu_top = $nav->menu_top($nav->all()->toArray());
$temp = array("id" => $product->id, "name" => $product->name, "thumbnail" => $product->image, "price" => $product->price);
$data = Session::get('cookie');
//$data[$product->id]=$temp;
if (is_null($data)) {
$data[$product->id] = $temp;
} elseif (isset($data[$product->id])) {
unset($data[$product->id]);
$data[$product->id] = $temp;
} else {
$data[$product->id] = $temp;
}
Session::put('cookie', $data);
$menu = $obj->menu_left($obj->all()->toArray());
return view('frontend.pages.subpages.detail', array('menu_top' => $menu_top, 'product' => $product, 'relative' => $relative, 'cat' => $cat, 'rateAvg' => $rateAvg, 'count' => $count, 'review' => $review, 'menu' => $menu, 'img' => $img, 'color' => $color, 'size' => $size, 'mapColor' => $mapColor, 'mapSize' => $mapSize));
}