<?php

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

/**
 * 用户表
 */
class Ameasure extends DooModel
{

    public $pmid;
    public $pid;
    public $stid;
    public $uid;
    public $pmname;
    public $contracttotal;
    public $_table = 'jl_project_measure';
    public $_primarykey = 'pmid';
    public $_fields = array('pmid', 'pid', 'stid', 'uid', 'pmname', 'contracttotal');

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

    public function getRowAll($pid = 0)
    {
        if ($pid > 0) {
            return $this->find(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
        } else {
            return $this->find(array('asArray' => TRUE));
        }
    }

    public function getTotalRow($pid = 0)
    {
        return $this->count(array('where' => 'pid=?', 'param' => array($pid)));

    }

    public function getRowswith($stid)
    {
        return $this->find(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
    }

    public function getRowNum($stid)
    {
        return $this->count(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
    }

    public function del($pmid)
    {
        return $this->delete(array('where' => 'pmid=?', 'param' => array($pmid)));
    }

}

?>