feat/task1-c-wallet
devil_gong 2018-10-15 11:21:30 +08:00
parent ddfb8066cc
commit f4d9a218e1
3 changed files with 41 additions and 21 deletions

View File

@ -61,7 +61,7 @@ class GoodsController extends CommonController
$this->assign('home_seo_site_title', $goods[0]['title']);
// 商品访问统计
M('Goods')->where(array('id'=>$id))->setInc('access_count');
GoodsService::GoodsAccessCountInc(['goods_id'=>$id]);
// 左侧商品 看了又看
$params = [

View File

@ -507,5 +507,23 @@ class GoodsService
}
return DataReturn('处理成功', 0, $data);
}
/**
* 商品访问统计加1
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-15
* @desc description
* @param [array] $params [输入参数]
*/
public static function GoodsAccessCountInc($params = [])
{
if(!empty($params['goods_id']))
{
return M('Goods')->where(array('id'=>intval($params['goods_id'])))->setInc('access_count');
}
return false;
}
}
?>

File diff suppressed because one or more lines are too long