Merge branch 'master' into dev

This commit is contained in:
zpc 2025-06-02 09:47:50 +08:00
commit 267a896532
3 changed files with 21 additions and 6 deletions

View File

@ -2175,9 +2175,8 @@ class Statistics extends Base
AND u.istest = 0
AND o.status = 1
AND o.addtime >= UNIX_TIMESTAMP(?)
AND o.addtime <= UNIX_TIMESTAMP(?)
GROUP BY DATE(FROM_UNIXTIME(o.addtime))
", [$startDate, $endDate]);
", [$startDate]);
// 2. 登录人数统计
$loginStats = Db::query("
@ -2214,9 +2213,8 @@ class Statistics extends Base
AND u.status = 1
AND u.istest = 0
AND o.created_at >= ?
AND o.created_at <= ?
GROUP BY DATE(o.created_at)
", [$startDate, $endDate]);
", [$startDate]);
// 生成日期范围内的所有日期
$allDates = [];

View File

@ -20,6 +20,7 @@ use app\common\server\LiveMoney;
use PhpOffice\PhpSpreadsheet\Chart\Legend;
use think\facade\Db;
use think\Request;
use think\facade\Log;
use app\common\server\Qcode;
use Qcloud\Cos\Client;
class User extends Base
@ -164,9 +165,10 @@ class User extends Base
$save['nickname'] = $nickname;
}
if ($imagebase && $imagebase != "") {
$base64Image = str_replace('data:image/png;base64,', '', $imagebase);
// 提取实际的 Base64 数据部分(去除 data:image/png;base64, 前缀)
$base64_data = substr($imagebase, strpos($imagebase, ',') + 1);
// 解码 Base64 数据为二进制数据
$binaryData = base64_decode($base64Image);
$binaryData = base64_decode($base64_data);
// 初始化腾讯云 COS 客户端
$cosClient = new Client([
'region' => $this->region,
@ -1311,5 +1313,19 @@ class User extends Base
}
}
/**
* 用户注销
*/
public function user_log_off()
{
$user_id = $this->getuserid();
if ($user_id == 0) {
return $this->renderError("未登录");
}
$type = request()->param('type', 0);
// 输出收集的所有日志
Log::info("用户id申请注销==》" . $user_id . "==>" . ($type == 0 ? "注销账号" : "取消注销账号"));
return $this->renderSuccess(($type == 0 ? "注销账号" : "取消注销账号") . "成功");
}
}

View File

@ -67,6 +67,7 @@ Route::any('invitation_commission', 'User/invitation_commission');
Route::any('recharge', 'User/recharge');
Route::any('item_card_list', 'User/item_card_list');
Route::any('bind_invite_code', 'User/bind_invite_code');
Route::any('user_log_off', 'User/user_log_off');
#Rank.php排行榜
#============================
Route::any('rank_week', 'Rank/rank_week');