本文整理匯總了PHP中app\Comment::getAvg方法的典型用法代碼示例。如果您正苦於以下問題:PHP Comment::getAvg方法的具體用法?PHP Comment::getAvg怎麽用?PHP Comment::getAvg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Comment
的用法示例。
在下文中一共展示了Comment::getAvg方法的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));
}