|
@@ -30,6 +30,13 @@ function create_token(string $extra = ''): string
|
|
|
return md5($extra . time().uniqid('likeshop'));
|
|
return md5($extra . time().uniqid('likeshop'));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/*
|
|
|
|
|
+ * 导出数据到日志文件
|
|
|
|
|
+ * */
|
|
|
|
|
+function outFileLog($data,$filename='log',$title='data'){
|
|
|
|
|
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/runtime/'.$filename.'.txt', PHP_EOL .date('Y-m-d h:i:s', time()).'~'.$title.':' . json_encode($data,JSON_UNESCAPED_UNICODE), FILE_APPEND);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function getMonthFirstAndLastDay($year, $month) {
|
|
function getMonthFirstAndLastDay($year, $month) {
|
|
|
// 计算该月份的第一天
|
|
// 计算该月份的第一天
|
|
|
$firstDay = date('Y-m-01', strtotime("$year-$month-01"));
|
|
$firstDay = date('Y-m-01', strtotime("$year-$month-01"));
|