table_home_userappfield.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_home_userappfield.php 27449 2012-02-01 05:32:35Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_home_userappfield extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'home_userappfield';
  15. $this->_pk = '';
  16. parent::__construct();
  17. }
  18. public function delete_by_uid_appid($uid = 0, $appid = 0) {
  19. $parameter = array($this->_table);
  20. $wherearr = array();
  21. if($uid) {
  22. $parameter[] = $uid;
  23. $wherearr[] = is_array($uid) ? 'uid IN(%n)' : 'uid=%d';
  24. }
  25. if($appid) {
  26. $parameter[] = $appid;
  27. $wherearr[] = is_array($appid) ? 'appid IN(%n)' : 'appid=%d';
  28. }
  29. $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : '';
  30. return DB::query("DELETE FROM %t $wheresql", $parameter);
  31. }
  32. public function delete_by_uid($uids) {
  33. return DB::delete($this->_table, DB::field('uid', $uids));
  34. }
  35. }
  36. ?>