簽到打卡設計

2021-10-05 13:28:41 字數 3385 閱讀 2946

入夏第一天了,可是武漢依然這樣讓我非常的惆悵,但是總不能荒廢,必須的坐點什麼,於是想著天天吃雞,研究簽到獎勵大概設計模式,再結合以前簽到做了如下表設計,大概就是如下圖了,當然沒有powerdesigner做資料庫設計,自己搞嗎就不用那麼麻煩了,手敲出所有表在乙個頁面也能看出大概關聯了

colock_desc text not null comment '玩法規則',

mornong_number_user mediumint not null default '0'comment '早起打卡參與人數',

morning_start_time int not null default '0' comment '早起可打卡時間開始時間',

morning_end_time int not null default '0' comment '早起可打卡時間結束時間',

night_number_user mediumint not null default '0' comment '晚上打卡參與人數',

night_start_time int not null default '0' comment '晚上可打卡時間開始時間',

night_end_time int not null default '0' comment '晚上可打卡時間結束時間'

)create table ph_colockin_images(

colock_id int primary key auto_increment,

colock_images varchar(255) not null comment 'url',

) comment '打卡庫表'

create table ph_colcokin_user(

user_id int primary key,

accumulation_day smallint not null default '0' comment '累計打卡天數',

continuation_morning smallint not null default '0' comment '連續早起',

share_number smallint not null default '0' comment '分享累加',

last__morningtoday int not null comment '上次早起打卡時間',

continuation_night smallint not null default '0' comment '連續早睡',

last_nighttoday int not null default '0' comment '上次睡覺打卡時間',

history_max_today smallint not null default '0' comment '歷史最高簽到天數',

colcokin_achievement_all varchar(255) not null default '' comment '簽到勳章,號分割',

share_achievement_all varchar(255) not null default '' comment '分享勳章,號分割'

) comment '使用者簽到表'

create table ph_achievement(

id smallint primary key auto_increment,

number smallint not null default '0' comment '條件數量(簽到天數,分享人數)',

achievement_img varchar(255) not null comment '成就未點亮圖示',

acheievement_hover_img varchar(255) not null comment '成就點亮圖示',

type tinyint(1) not null comment '型別 1:簽到勳章 2:分享勳章'

) comment '勳章表'

create table ph_colcokin_user_log(

id int primary key auto_increment,

user_id int not null comment '使用者id',

oneday_time int not null comment '今天日期',

morning_colockin int not null default '0' comment '早晨打卡時間',

night_colockin int not null default '0' comment '晚上打卡時間',

sleep int not null default '0' comment '睡眠時間第二天早起時間減去晚睡打卡時間'

) comment '使用者每日簽到記錄表,最長31天,按時間覆蓋,後面替換前面**處理'

create table ph_colockin_prize(

cp_id int primary key,

number smallint not null comment '達到多少天贈送獎勵,不能有重複的',

type tinyint(1) not null comment '獎勵型別1:**次數 2:補簽卡 3:積分',

third_id mediumint not null default '0' comment '**活動id,type:1贈送**就是luckdraw表自增id,type:3,贈送的積分'

) comment '簽到獎勵表'

2023年4月28號補充:下午實際寫**的時候覺得第一張表不靠譜,去掉了,直接把儲存在配置檔案裡面去了,因為這個是不會經常改動的,或者問你們有系統表的,直接存json丟到表裡面比較好,因為這種一次性的資料,大可不必浪費查詢資料庫時

Python自動簽到打卡

通過 selenium 框架來實現自動打卡 導庫 usr bin env python3 coding utf 8 software pycharm virtualenv workon contact 1040691703 qq.com desc code descripton author 未昔 ...

Js 實現每日簽到打卡軌跡功能。

1.0 核心檔案 calendar.js var calutil draw function signlist 獲取當前選擇的年月 setmonthandday function break case next var nowmonth calendar month span html split ...

php 簽到資料表設計

mysql資料庫 簽到表設計 我這個只是滿足當下我的需求,希望這個會對你們的專案有些幫助 nowdata date y m d 當前日期 newarr1 sh get week 獲取一周的日期 newarr2 array column newarr1,date newarr3 array flip ...