#!/bin/bash
# 接收参数：音频ID 音频名称 用户标识
audio_id=$1
audio_name=$2
user_id=$3
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
date_only=$(date "+%Y-%m-%d")
week=$(date "+%Y-W%V")
month=$(date "+%Y-%m")
year=$(date "+%Y")

# 记录到日志文件
echo "$timestamp|$date_only|$week|$month|$year|$audio_id|$audio_name|$user_id" >> /var/www/audio/stats/play.log
