wikipoints/ground/models/Goods.php

25 lines
335 B
PHP

<?php
class Goods extends Model
{
function __construct($fromArray = array())
{
$this->_tableName_ = 'goods';
parent::__construct($fromArray);
}
static function model()
{
return new self();
}
function getRandom($count = 6)
{
return $this->getAll(array(
'order' => 'RAND()',
'limit' => (int) $count,
));
}
}