query.sql 537 B

12345678910
  1. -- select m.* from message m join message_type mt on m.msg_type_id = mt.id
  2. -- where m.status = 1 and mt.remind_type_id = 2 and timestampdiff(hour,m.create_at,now())>=48
  3. -- and timestampdiff(hour,m.update_at,now())>=24 and m.push_count < mt.notice_count;
  4. select * from message m join message_type mt on m.msg_type_id = mt.id
  5. where m.status = 1 and mt.remind_type_id = 3
  6. and ( find_in_set( mt.push_date,concat('w', weekday(now() ) +1) )or
  7. find_in_set( mt.push_date,concat('w', day(now() ) +1) ))