36 lines
811 B
PHP
36 lines
811 B
PHP
<?php
|
|
|
|
namespace models;
|
|
|
|
use mt;
|
|
use phpcommon\SqlHelper;
|
|
|
|
class FragmentPool extends BaseModel {
|
|
|
|
public static function dropHero()
|
|
{
|
|
$items = self::internalGet(0);
|
|
}
|
|
|
|
public static function dropGun()
|
|
{
|
|
$items = self::internalGet(1);
|
|
}
|
|
|
|
private static function internalGet($type)
|
|
{
|
|
$allocTime = myself()->_getNowDaySeconds() +
|
|
intval((myself()->_getNowTime() - myself()->_getNowDaySeconds()) / 3600) * 3600;
|
|
$rows = SqlHelper::ormSelect
|
|
(myself()->_getMysql($targetId),
|
|
't_fragment_pool',
|
|
array(
|
|
'fragment_type' => $type,
|
|
'alloc_time' => $allocTime,
|
|
)
|
|
);
|
|
return $rows ? $rows : array();
|
|
}
|
|
|
|
}
|