debug
This commit is contained in:
@@ -603,6 +603,7 @@ EOF;
|
|||||||
$arrArgs = [
|
$arrArgs = [
|
||||||
'intVId' => $Video->v_id,
|
'intVId' => $Video->v_id,
|
||||||
'strPinyin' => $Video->v_name_en,
|
'strPinyin' => $Video->v_name_en,
|
||||||
|
'strPinYin' => $Video->v_name_en,
|
||||||
];
|
];
|
||||||
if ($arrUrlFamily && !empty($arrUrlFamily)) {
|
if ($arrUrlFamily && !empty($arrUrlFamily)) {
|
||||||
|
|
||||||
|
|||||||
@@ -69,10 +69,35 @@ db.video.find({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
db.video.find({
|
||||||
|
"v_play_url.douban": { $exists: true }
|
||||||
|
}).count()
|
||||||
// 删除某个资源线路的数据
|
// 删除某个资源线路的数据
|
||||||
db.video.updateMany(
|
db.video.updateMany(
|
||||||
{},
|
{},
|
||||||
{ $unset: { "v_play_url.douban": "" } }
|
{ $unset: { "v_play_url.douban": "" } }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 删除某个资源线路的数据 30天内
|
||||||
|
db.video.find({
|
||||||
|
created_at: {
|
||||||
|
$gte: new Date(Date.now() - 30*24*60*60*1000)
|
||||||
|
},
|
||||||
|
"v_play_url.youzhi": { $exists: true }
|
||||||
|
}).count()
|
||||||
|
|
||||||
|
db.video.updateMany(
|
||||||
|
{
|
||||||
|
created_at: {
|
||||||
|
$gte: new Date(Date.now() - 30*24*60*60*1000)
|
||||||
|
},
|
||||||
|
"v_play_url.youzhi": { $exists: true }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$unset: { "v_play_url.youzhi": "" }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
````
|
````
|
||||||
37
doc/优化.md
37
doc/优化.md
@@ -12,3 +12,40 @@
|
|||||||
|
|
||||||
git restore .
|
git restore .
|
||||||
git clean -fd
|
git clean -fd
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// =============================
|
||||||
|
// 停留时长统计(U-Web 自定义事件)
|
||||||
|
// =============================
|
||||||
|
(function () {
|
||||||
|
var enterTs = Date.now(); // 页面进入时间
|
||||||
|
|
||||||
|
// 页面可见性变化(比 beforeunload 更稳定)
|
||||||
|
var totalStay = 0;
|
||||||
|
var lastVisibleTs = enterTs;
|
||||||
|
|
||||||
|
document.addEventListener("visibilitychange", function () {
|
||||||
|
if (document.visibilityState === "hidden") {
|
||||||
|
totalStay += Date.now() - lastVisibleTs;
|
||||||
|
} else if (document.visibilityState === "visible") {
|
||||||
|
lastVisibleTs = Date.now();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 页面关闭/刷新时上报
|
||||||
|
window.addEventListener("beforeunload", function () {
|
||||||
|
var now = Date.now();
|
||||||
|
totalStay += now - lastVisibleTs;
|
||||||
|
|
||||||
|
// 上报自定义事件
|
||||||
|
_czc.push([
|
||||||
|
"_trackEvent",
|
||||||
|
"page_duration", // 事件类别
|
||||||
|
location.pathname, // 事件名称:当前页面路径
|
||||||
|
"stay_time", // 标签
|
||||||
|
totalStay // value:停留时长(毫秒)
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user