Forráskód Böngészése

修改产品为多个分类的时候打开产品详情页报错问题

等风来 7 éve
szülő
commit
75a32e01bf

+ 1 - 0
application/routine/common.php

@@ -40,6 +40,7 @@ function setView($uid,$product_id=0,$cate=0,$type='',$content='',$min=20){
             $Db->where(['id'=>$view['id']])->update(['count'=>$view['count']+1,'add_time'=>time()]);
         }
     }else{
+        $cate = explode(',',$cate)[0];
         $Db->insert([
             'add_time'=>time(),
             'count'=>1,

+ 2 - 2
application/routine/view/crmebN/pages/product-con/index.wxml

@@ -38,10 +38,10 @@
       <view>销量:{{storeInfo.sales}}{{storeInfo.unit_name}}</view>
     </view>
   </view>
-  <!-- <view class='block-bar' bindtap='goCoupon'>
+  <view class='block-bar' bindtap='goCoupon'>
     <text class='title'>领券</text>
     <text>领取优惠券 </text>
-  </view> -->
+  </view>
   <!-- <view class='block-bar integral' wx:if="{{storeInfo.give_integral > 0}}">
     <text class='title'>积分</text>
     <text>购买可获得{{storeInfo.give_integral}}积分</text>

+ 2 - 1
application/wap/common.php

@@ -40,6 +40,7 @@ function setView($uid,$product_id=0,$cate=0,$type='',$product_type = 'product',$
             $Db->where(['id'=>$view['id']])->update(['count'=>$view['count']+1,'add_time'=>time()]);
         }
     }else{
+        $cate = explode(',',$cate)[0];
         $Db->insert([
             'add_time'=>time(),
             'count'=>1,
@@ -51,4 +52,4 @@ function setView($uid,$product_id=0,$cate=0,$type='',$product_type = 'product',$
             'content'=>$content
         ]);
     }
-}
+}