用户登录日志表,如何获取用户连续登陆的天数,用户在一天内可多次登陆;附上建表语句;
CREATE TABLE ap_user_login_logs
(id
bigint(20) NOT NULL AUTO_INCREMENT,user_id
bigint(20) NOT NULL DEFAULT '0',ip
varchar(20) NOT NULL DEFAULT '',login_time
datetime NOT NULL DEFAULT '0000-00-00 00:00:00',updated
datetime NOT NULL DEFAULT '0000-00-00 00:00:00',created
datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
/*Data for the table ap_user_login_logs
*/
insert into ap_user_login_logs
(id
,user_id
,ip
,login_time
,updated
,created
) values (2,1,'','2016-09-07 19:50:16','0000-00-00 00:00:00','0000-00-00 00:00:00'),(3,1,'','2016-09-08 19:50:22','0000-00-00 00:00:00','0000-00-00 00:00:00'),(4,1,'','2016-09-09 19:50:24','0000-00-00 00:00:00','0000-00-00 00:00:00'),(5,2,'','2016-09-07 19:50:27','0000-00-00 00:00:00','0000-00-00 00:00:00'),(6,2,'','2016-09-08 19:50:31','0000-00-00 00:00:00','0000-00-00 00:00:00'),(7,2,'','2016-09-08 19:50:35','0000-00-00 00:00:00','0000-00-00 00:00:00'),(8,3,'','2016-09-08 19:52:08','0000-00-00 00:00:00','0000-00-00 00:00:00'),(9,3,'','2016-09-09 19:52:12','0000-00-00 00:00:00','0000-00-00 00:00:00'),(10,4,'','2016-09-09 19:52:21','0000-00-00 00:00:00','0000-00-00 00:00:00'),(12,1,'','2016-09-10 16:09:45','0000-00-00 00:00:00','0000-00-00 00:00:00'),(13,1,'','2016-09-10 21:09:54','0000-00-00 00:00:00','0000-00-00 00:00:00'),(14,2,'','2016-09-10 16:10:07','0000-00-00 00:00:00','0000-00-00 00:00:00'),(15,3,'','2016-09-10 16:10:16','0000-00-00 00:00:00','0000-00-00 00:00:00'),(16,4,'','2016-09-10 16:11:15','0000-00-00 00:00:00','0000-00-00 00:00:00');
/*Table structure for table ap_user_praise
*/