model()->select()->from('orders')->where(array('fields' => 'orderid=? and is_state=?', 'values' => array($orderid, 1)))->count(); } } ?>