table_test1.php 579 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace index;
  3. use discuz_table;
  4. use DB;
  5. if(!defined('IN_DISCUZ')) {
  6. exit('Access Denied');
  7. }
  8. class table_test1 extends discuz_table
  9. {
  10. public static function t() {
  11. static $_instance;
  12. if(!isset($_instance)) {
  13. $_instance = new self();
  14. }
  15. return $_instance;
  16. }
  17. public function __construct() {
  18. $this->_table = 'sample_test1';
  19. $this->_pk = '';
  20. parent::__construct();
  21. }
  22. public function fetch_all_by_uid($uid) {
  23. return ['uid' => $uid, 'name' => 'test'];
  24. //return DB::fetch_all('SELECT * FROM %t WHERE uid=%d', [$this->_table, $uid]);
  25. }
  26. }