musers.php 857 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. Doo::loadCore('db/DooModel');
  3. class Musers extends DooModel {
  4. public $id;
  5. public $username;
  6. public $password;
  7. public $groups;
  8. public $salt;
  9. public $_table = 'zh_manager';
  10. public $_primarykey = 'id';
  11. public $_fields = array('id', 'username', 'password', 'groups', 'salt');
  12. public function __construct() {
  13. parent::setupModel(__CLASS__);
  14. }
  15. public function getCountz() {
  16. return $this->count();
  17. }
  18. public function getAll($limit) {
  19. return $this->find(array('limit' => $limit, 'asArray' => TRUE));
  20. }
  21. public function muserAdd($muserArray) {
  22. if (!is_array($muserArray))
  23. return FALSE;
  24. $this->username = $muserArray['username'];
  25. $this->password = $muserArray['password'];
  26. $this->salt = $muserArray['salt'];
  27. $this->groups = $muserArray['groups'];
  28. return $this->insert();
  29. }
  30. }
  31. ?>