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

56

... ... @@ -39,7 +39,14 @@ class GoodsdetailsController extends WeChatBaseController{
}else{
$this -> assign('is_recomm',2);
}
//添加浏览记录
$uid = cmf_get_current_user_id();
$data_browsing_history = Db::name('browsing_history') -> where("uid = ".$uid." and goods_id =".$goods_id['goods_id']) -> find();
if(empty($data_browsing_history)){
$browsing_history['uid'] = $uid;
$browsing_history['goods_id'] = $goods_id['goods_id'];
Db::name('browsing_history') -> insert($browsing_history);
}
return $this -> fetch();
}
... ...
... ... @@ -284,6 +284,14 @@ class IndexController extends WeChatBaseController
}else{
$this -> assign('is_recomm',2);
}
//添加浏览记录
$uid = cmf_get_current_user_id();
$data_browsing_history = Db::name('browsing_history') -> where("uid = ".$uid." and goods_id =".$goods_id['goods_id']) -> find();
if(empty($data_browsing_history)){
$browsing_history['uid'] = $uid;
$browsing_history['goods_id'] = $goods_id['goods_id'];
Db::name('browsing_history') -> insert($browsing_history);
}
return $this -> fetch();
}
... ...