当前位置:   article > 正文

签到打卡设计_打卡数据库的表设计

打卡数据库的表设计

入夏第一天了,可是武汉依然这样让我非常的惆怅,但是总不能荒废,必须的坐点什么,于是想着天天吃鸡,研究签到奖励大概设计模式,再结合以前签到做了如下表设计,大概就是如下图了,当然没有powerdesigner做数据库设计,自己搞吗就不用那么麻烦了,手敲出所有表在一个页面也能看出大概关联了

 参考的页面如下:

 

这些图片站酷的也有,千图的也有截图的部分app的也有将就着看吧。你看吃鸡是每天都有金币奖励或者服饰币奖励,所以设计谁知道运营那天我每天要赠送一个积分是吧 ,上面图片只需要在加上一张奖励记录表就好

  1. create table ph_colockin(
  2. colock_id tinyint(1) primary key AUTO_INCREMENT,
  3. colock_desc text not null comment '玩法规则',
  4. mornong_number_user MEDIUMINT not null default '0'comment '早起打卡参与人数',
  5. morning_start_time int not null default '0' comment '早起可打卡时间开始时间',
  6. morning_end_time int not null default '0' comment '早起可打卡时间结束时间',
  7. night_number_user MEDIUMINT not null default '0' comment '晚上打卡参与人数',
  8. night_start_time int not null default '0' comment '晚上可打卡时间开始时间',
  9. night_end_time int not null default '0' comment '晚上可打卡时间结束时间'
  10. )
  11. create table ph_colockin_images(
  12. colock_id int primary key AUTO_INCREMENT,
  13. colock_images varchar(255) not null comment '图片url',
  14. colock_img_type tinyint not null comment '类型1:打卡图片 2:分享图片'
  15. ) comment '打卡图片库表'
  16. create table ph_colcokin_user(
  17. user_id int primary key,
  18. accumulation_day smallint not null default '0' comment '累计打卡天数',
  19. continuation_morning smallint not null default '0' comment '连续早起',
  20. share_number smallint not null default '0' comment '分享累加',
  21. last__morningtoday int not null comment '上次早起打卡时间',
  22. continuation_night smallint not null default '0' comment '连续早睡',
  23. last_nighttoday int not null default '0' comment '上次睡觉打卡时间',
  24. history_max_today SMALLINT not null default '0' comment '历史最高签到天数',
  25. colcokin_achievement_all varchar(255) not null default '' comment '签到勋章,号分割',
  26. share_achievement_all varchar(255) not null default '' comment '分享勋章,号分割'
  27. ) comment '用户签到表'
  28. create table ph_achievement(
  29. id smallint primary key AUTO_INCREMENT,
  30. number smallint not null default '0' comment '条件数量(签到天数,分享人数)',
  31. achievement_img varchar(255) not null comment '成就未点亮图标',
  32. acheievement_hover_img varchar(255) not null comment '成就点亮图标',
  33. type tinyint(1) not null comment '类型 1:签到勋章 2:分享勋章'
  34. ) comment '勋章表'
  35. create table ph_colcokin_user_log(
  36. id int primary key AUTO_INCREMENT,
  37. user_id int not null comment '用户id',
  38. oneday_time int not null comment '今天日期',
  39. morning_colockin int not null default '0' comment '早晨打卡时间',
  40. night_colockin int not null default '0' comment '晚上打卡时间',
  41. sleep int not null default '0' comment '睡眠时间第二天早起时间减去晚睡打卡时间'
  42. ) comment '用户每日签到记录表,最长31天,按时间覆盖,后面替换前面代码处理'
  43. create table ph_colockin_prize(
  44. cp_id int primary key,
  45. number smallint not null comment '达到多少天赠送奖励,不能有重复的',
  46. type tinyint(1) not null comment '奖励类型1:抽奖次数 2:补签卡 3:积分',
  47. third_id mediumint not null default '0' comment '抽奖活动id,type:1赠送抽奖就是luckdraw表自增id,type:3,赠送的积分'
  48. ) comment '签到奖励表'

顺带说说可能我把一张图片上的二维码去掉了,哪里扫码会出现一个支付购买东西的页面,重分享链接注册的人会给分享人累加分享次数,

欢迎大家私信补充或者评论补充

2020年4月28号补充:下午实际写代码的时候觉得第一张表不靠谱,去掉了,直接把保存在配置文件里面去了,因为这个是不会经常改动的,或者问你们有系统表的,直接存json丢到表里面比较好,因为这种一次性的数据,大可不必浪费查询数据库时间

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/839636
推荐阅读
相关标签
  

闽ICP备14008679号