detail mv goods

feat/task1-c-wallet
devil_gong 2018-08-29 11:21:00 +08:00
parent 26ab67276b
commit 8f467d3492
7 changed files with 12 additions and 9 deletions

View File

@ -102,6 +102,9 @@ class GoodsController extends CommonController
// 产地
$v['place_origin_text'] = M('Region')->where(['id'=>$v['place_origin']])->getField('name');
// 商品url地址
$v['goods_url'] = HomeUrl('Goods', 'Index', ['id'=>$v['id']]);
// 创建时间
$v['add_time'] = date('Y-m-d H:i:s', $v['add_time']);

View File

@ -62,10 +62,10 @@
<foreach name="list" item="v">
<tr id="data-list-{{$v.id}}" <if condition="$v['is_shelves'] eq 0">class="am-active"</if>>
<td>
<a href="javascript:;" target="_blank" title="{{$v.title}}">
<a href="{{$v.goods_url}}" target="_blank" title="{{$v.title}}">
<img src="{{$image_host}}{{$v['images']}}" class="am-img-thumbnail am-radius goods-images am-hide-sm-only" />
</a>
<a href="javascript:;" target="_blank" title="{{$v.title}}" <if condition="!empty($v['title_color'])"> style="color:{{$v.title_color}};" </if> >{{$v.title}}</a>
<a href="{{$v.goods_url}}" target="_blank" title="{{$v.title}}" <if condition="!empty($v['title_color'])"> style="color:{{$v.title_color}};" </if> >{{$v.title}}</a>
</td>
<td>
{{$v.price}}

View File

@ -9,7 +9,7 @@ namespace Home\Controller;
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class DetailController extends CommonController
class GoodsController extends CommonController
{
/**
* [_initialize 前置操作-继承公共前置方法]
@ -33,10 +33,10 @@ class DetailController extends CommonController
*/
public function Index()
{
$goods_id = I('goods_id');
$id = I('id');
$params = [
'where' => [
'g.id' => $goods_id,
'g.id' => $id,
'g.is_delete_time' => 0,
],
'is_photo' => true,

View File

@ -192,12 +192,12 @@
<foreach name="left_goods" key="key" item="v">
<li <if condition="$key eq 0">class="first"</if>>
<div class="p-img">
<a href="{{:U('/Home/Detail/Index', ['goods_id'=>$v['id']])}}">
<a href="{{:U('/Home/Goods/Index', ['id'=>$v['id']])}}">
<img alt="{{$v.title}}" src="{{$v.images}}">
</a>
</div>
<div class="p-name">
<a href="{{:U('/Home/Detail/Index', ['goods_id'=>$v['id']])}}">{{$v.title}}</a>
<a href="{{:U('/Home/Goods/Index', ['id'=>$v['id']])}}">{{$v.title}}</a>
</div>
<div class="p-price"><strong>¥{{$v.price}}</strong></div>
</li>
@ -260,7 +260,7 @@
<foreach name="detail_like_goods" key="key" item="v">
<li>
<div class="i-pic limit">
<a href="{{:U('/Home/Detail/Index', ['goods_id'=>$v['id']])}}">
<a href="{{:U('/Home/Goods/Index', ['id'=>$v['id']])}}">
<img alt="{{$v.title}}" src="{{$v.home_recommended_images}}" />
</a>
<p class="ellipsis">{{$v.title}}</p>

View File

@ -146,7 +146,7 @@
<div class="goods-title ellipsis">{{$goods.title}}</div>
<div class="price">¥{{$goods.price}}</div>
</div>
<a href="{{:U('/Home/Detail/Index', ['goods_id'=>$goods['id']])}}">
<a href="{{:U('/Home/Goods/Index', ['id'=>$goods['id']])}}">
<img src="{{$goods.home_recommended_images}}" />
</a>
</div>