<?php

Doo::loadCore('db/DooModel');

class Sale extends DooModel {

    public $id;
    public $salename;
    public $promocode;
    public $total;
    public $usez;
    public $_table = 'zh_sales_record';
    public $_primarykey = 'id';
    public $_fields = array('id', 'salename', 'promocode', 'total', 'usez');

    public function __construct() {
	   parent::setupModel(__CLASS__);
    }

    public function getall($limit) {
        return $this->find(array('limit' => $limit, 'asArray' => TRUE));
    }
}

?>