feat(zy): 添加访客记录功能

- 新增 zy_visitor 表,用于记录访客信息
- 调整签到活动逻辑,暂时注释掉活动状态检查
This commit is contained in:
2025-06-28 21:42:42 +08:00
parent e30de5cc79
commit 349841a8a1
2 changed files with 21 additions and 4 deletions

19
add.sql
View File

@@ -47,4 +47,21 @@ ADD COLUMN `name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称' AFTER `statu
ADD COLUMN `begin_date` date NULL DEFAULT NULL COMMENT '有效期开始' AFTER `name`, ADD COLUMN `begin_date` date NULL DEFAULT NULL COMMENT '有效期开始' AFTER `name`,
ADD COLUMN `end_date` date NULL DEFAULT NULL COMMENT '有效期结束' AFTER `begin_date`, ADD COLUMN `end_date` date NULL DEFAULT NULL COMMENT '有效期结束' AFTER `begin_date`,
ADD COLUMN `intro` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明' AFTER `end_date`; ADD COLUMN `intro` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明' AFTER `end_date`;
-- 已执行 2025-06-17 -- 已执行 2025-06-17
CREATE TABLE `zy_visitor` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '类型0俱乐部/1球馆/2用户',
`obj_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '对象id',
`user_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '用户id',
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '昵称',
`avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '头像',
`gender` tinyint(4) NOT NULL DEFAULT 0 COMMENT '性别0女1男',
`times` int(11) NOT NULL DEFAULT 0 COMMENT '次数',
`create_time` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `type` (`type`) USING BTREE,
KEY `obj_id` (`obj_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='标签';
-- 已执行 2025-06-28

View File

@@ -86,9 +86,9 @@ class Sys extends Base
public function signin() public function signin()
{ {
$signSet = SignSet::where('status', 1)->select(); $signSet = SignSet::where('status', 1)->select();
if (empty($signSet)) { // if (empty($signSet)) {
$this->error('没有签到活动'); // $this->error('没有签到活动');
} // }
Db::startTrans(); Db::startTrans();
try { try {
$user = auth_user(); $user = auth_user();