hosts.php 849 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. Doo::loadCore('db/DooModel');
  3. class Hosts extends DooModel {
  4. public $id;
  5. public $serverid;
  6. public $hostname;
  7. public $domain;
  8. public $sales;
  9. public $status;
  10. public $webver;
  11. public $softver;
  12. public $created_at;
  13. public $updated_at;
  14. public $_table = 'sfu_hosts';
  15. public $_primarykey = 'id';
  16. public $_fields = array('id', 'serverid', 'hostname', 'domain', 'sales', 'status', 'webver', 'softver', 'created_at', 'updated_at');
  17. public function __construct() {
  18. parent::setupModel(__CLASS__);
  19. }
  20. public function getServerHosts($sql,$limit){
  21. return $this->find(array('where' => $sql, 'desc' => 'id', 'limit' => $limit, 'asArray' => TRUE));
  22. }
  23. public function getRowbyID($id){
  24. return $this->getOne(array('where' => 'id='.$id, 'asArray' => TRUE));
  25. }
  26. }