table_common_statuser.php 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: table_common_statuser.php 27449 2012-02-01 05:32:35Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_statuser extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'common_statuser';
  15. $this->_pk = '';
  16. parent::__construct();
  17. }
  18. public function check_exists($uid, $daytime, $type) {
  19. $setarr = array(
  20. 'uid' => intval($uid),
  21. 'daytime' => intval($daytime),
  22. 'type' => $type
  23. );
  24. if(DB::result_first('SELECT COUNT(*) FROM '.DB::table($this->_table).' WHERE '.DB::implode_field_value($setarr, ' AND '))) {
  25. return true;
  26. } else {
  27. return false;
  28. }
  29. }
  30. public function clear_by_daytime($daytime) {
  31. $daytime = intval($daytime);
  32. DB::delete('common_statuser', "`daytime` != '$daytime'");
  33. }
  34. }
  35. ?>