field([ "FROM_UNIXTIME(createtime, '%Y-%m-%d') as date", // 转换创建时间为日期 "COUNT(*) as store_pv", // 店铺浏览量,包括所有商品浏览 "COUNT(DISTINCT ip) as store_uv", // 基于IP的店铺访客数 "COUNT(IF(page_type<>'other', 1, NULL)) as product_pv", // 商品浏览量 "COUNT(DISTINCT IF(page_type<>'other', ip, NULL)) as product_uv" // 商品访客数,基于IP ]) ->find(); return $data; } }