作者 lihan
1 个管道 的构建 通过 耗费 0 秒

判断商品是否显示积分

... ... @@ -127,7 +127,7 @@ class ZjCartController extends HomeBaseController
return false;
}
foreach ($data as $k => $item) {
if ($item['caid'] == 1) {
if ($item['caid'] == 2) {
$item['integral'] = '购买可获得' . $item['price'] * 2 . '积分';
} else {
$item['integral'] = '该商品无积分奖励';
... ...
... ... @@ -22,10 +22,10 @@ class GoodsController extends HomeBaseController
$html = '';
if (!empty($goodsList)) {
foreach ($goodsList as $item) {
if ($item['caid']==1){
$integral='购买可获得'.$item['price']*2 .'积分';
}else{
$integral='该商品无积分奖励';
if ($item['caid'] == 2) {
$integral = '购买可获得' . $item['price'] * 2 . '积分';
} else {
$integral = '该商品无积分奖励';
}
$html .= '
<a href="' . url('goods/Goods/detail', ['id' => $item['id']]) . '">
... ... @@ -42,7 +42,7 @@ class GoodsController extends HomeBaseController
</p>
<div class="people">
<p class="people_weight">
'. $integral .'
' . $integral . '
</p>
<p class="people_money">¥<span class="money">' . $item['price'] . '</span></p>
</div>
... ... @@ -91,11 +91,12 @@ class GoodsController extends HomeBaseController
return Db::name('zj_category')->field('id,name')->where(['cid' => $cid])->select()->toArray();
}
public function getGoodsComment($gid) {
public function getGoodsComment($gid)
{
return Db::name('zj_evaluate')->alias('e')
->field('u.user_nickname,avatar,e.content,e.create_time')
->join('user u', 'u.id=e.uid')
->where(['gid'=>$gid])
->where(['gid' => $gid])
->order('create_time DESC')
->select()
->toArray();
... ...
... ... @@ -44,7 +44,7 @@ class IndexController extends HomeBaseController
}
}
}else {
$this->error('请从手机微信浏览器打开');
$this->error('请从微信浏览器打开');
}
}
... ...
... ... @@ -88,10 +88,10 @@
</if>
</p>
<p class="cart_tast">
<if condition="$vo.caid eq 1">
<if condition="$vo.caid eq 2">
<if condition="mb_strlen($vo.intro) gt 12">
{:mb_substr($vo.intro,0,12)}...
<else>
<else/>
{$vo.intro}
</if>
<else>
... ...
... ... @@ -54,7 +54,7 @@
</p>
<div class="people">
<p class="people_weight">
购买可获得40积分
</p>
<p class="people_money">
¥{$data.price}
... ...
... ... @@ -41,7 +41,11 @@
</p>
<div class="people">
<p class="people_weight">
<if condition="$vo.caid eq 1">购买可获得{$vo.price*2}积分<else>该商品无积分奖励</if>
<if condition="$vo.caid eq 2">
购买可获得{$vo.price*2}积分
<else/>
该商品无积分奖励
</if>
</p>
<p class="people_money"><span class="money">{$vo.price}</span></p>
</div>
... ...
... ... @@ -99,7 +99,10 @@
{$vo.intro}
</p>
<p class="good_points">
<if condition="$vo.caid eq 1">购买可获得{$vo.price*2}积分<else>该商品无积分奖励</if>
<if condition="$vo.caid eq 2">
购买可获得{$vo.price*2}积分
<else/>该商品无积分奖励
</if>
</p>
<div class="people">
<p class="people_price"><span class="money">{$vo.price}</span></p>
... ...