[ 'g.id' => $id, 'g.is_delete_time' => 0, ], 'is_photo' => true, 'is_attribute' => true, ]; $goods = GoodsService::GoodsList($params); $this->assign('goods', $goods[0]); $this->assign('home_seo_site_title', $goods[0]['title']); // 商品访问统计 M('Goods')->where(array('id'=>$id))->setInc('access_count'); // 左侧商品 看了又看 $params = [ 'where' => [ 'g.is_delete_time'=>0, 'g.is_shelves'=>1 ], 'order_by' => 'access_count desc', 'field' => 'g.id,g.title,g.title_color,g.price,g.images', 'n' => 10, ]; $this->assign('left_goods', GoodsService::GoodsList($params)); // 详情tab商品 猜你喜欢 $params = [ 'where' => [ 'g.is_delete_time'=>0, 'g.is_shelves'=>1, 'is_home_recommended'=>1, ], 'order_by' => 'sales_count desc', 'field' => 'g.id,g.title,g.title_color,g.price,g.images,g.home_recommended_images', 'n' => 16, ]; $this->assign('detail_like_goods', GoodsService::GoodsList($params)); $this->display('Index'); } } ?>