$value ) { $this->$key = $value; } $lid = $this->insert (); } return $lid; } /** * 根据参数字段更新相应字段(主键ID必须传) * @param array $item 相关需要更新的字段信息 * @return number 返回发票ID */ public function updateInvoiceStatisticsByIrid($item = array(), $irid = 0) { if (is_numeric ( $irid ) && is_array ( $item ) && ! empty ( $item )) { foreach ( $item as $key => $value ) { $this->$key = $value; } $lid = $this->update ( array ( 'where' => 'irid=' . $irid ) ); } return $lid; } function getClientByCid($cid) { $sql = "select sum(price) from " . $this->_table . " where staff= '" . $cid . "' and "; $query = Doo::db ()->query ( $sql ); $result = $query->fetch (); return $result; } /* * public function getProjectByIdList($projectid){ return $this->find ( array ('where' => "pid= '".$projectid."'", 'asArray' => TRUE ) ); } */ } ?>