本文整理汇总了PHP中TenYear::data_name方法的典型用法代码示例。如果您正苦于以下问题:PHP TenYear::data_name方法的具体用法?PHP TenYear::data_name怎么用?PHP TenYear::data_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TenYear
的用法示例。
在下文中一共展示了TenYear::data_name方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_data
protected function get_data($name, $isOne = false)
{
$className = TenYear::data_name($name);
if ($isOne) {
return new $className();
}
//$this->_objData[$className]++;
return TenYear::getInstance($className);
}
示例2: run
public function run()
{
$sql = "select * from test_account";
$this->query($sql);
while ($this->next_record()) {
$player_id = $this->get_field('player_id');
$objPropData = TenYear::getInstance(TenYear::data_name('PlayerProp'));
$prop_list = $objPropData->get_player_prop_by_item_position($player_id);
if (!empty($prop_list)) {
foreach ($prop_list as $prop) {
$objPropData->delete_player_prop($player_id, $prop);
}
}
echo "player:{$player_id} suc\n";
}
}
示例3: run
public function run()
{
$keys = Com_AdCache::factory('player')->keys("data|player:*");
if (!empty($keys)) {
foreach ($keys as $key) {
$player_info = $this->redis()->hash_get($key, array('player_id', 'level', 'union_id'));
if (intval($player_info['player_id']) <= 0) {
continue;
}
if (intval($player_info['level']) < 20) {
continue;
}
$objPlayerProp = TenYear::getInstance(TenYear::data_name('PlayerProp'));
$player_props = $objPlayerProp->get_player_all_prop($player_info['player_id']);
foreach ($player_props as $prop) {
if (isset($prop['intensive_level'])) {
echo "player_id={$player_info['player_id']}|player_prop_id={$prop['player_prop_id']}\n";
$objPlayerAchieve = TenYear::getInstance(TenYear::game_name('PlayerAchieve'));
$objPlayerAchieve->async_trigger_achieve_target($player_info['player_id'], 6, "1:" . $prop['quality'] . ":" . $prop['star_level'] . ":" . intval($prop['intensive_level']) . ":{$prop['player_prop_id']}", 4);
}
}
}
}
}
示例4: sys_data
public function sys_data($player_info)
{
TenYear::getInstance(TenYear::data_name('UnionInfo'))->set_union_player_sum_fpower($player_info['union_id'], $player_info['player_id'], $player_info['sum_fpower']);
echo $player_info['player_id'] . "--union_id=" . $player_info['union_id'] . "sync suc \n";
}
示例5: clear_bag
public function clear_bag($player_id)
{
$objPropData = TenYear::getInstance(TenYear::data_name('PlayerProp'));
$prop_list = $objPropData->get_player_prop_by_item_position($player_id);
if (!empty($prop_list)) {
foreach ($prop_list as $prop) {
$objPropData->delete_player_prop($player_id, $prop);
}
}
echo "send success";
}
示例6: get_data
/**
* 获取数据模型
* @param string $name
* @param boolean $isOne
*/
protected static function get_data($name, $isOne = false)
{
$className = TenYear::data_name($name);
if ($isOne) {
return new $className();
}
return TenYear::getInstance($className);
}
示例7: asyn_call_func
/**
* 异步回调方法
*
* @param unknown_type $className 类名
* @param unknown_type $classType 类类型 game, data, 空则表示全名
* @param unknown_type $function 方法名
* @param unknown_type $params 参数数组
* @return unknown
*/
public static function asyn_call_func($className, $classType, $function, $params)
{
$call = array();
if ($classType == 'game') {
$class['class'] = TenYear::game_name($className);
} elseif ($classType == 'data') {
$class['class'] = TenYear::data_name($className);
} else {
$class['class'] = $className;
}
$class['function'] = $function;
$class['params'] = $params;
return Com_Queued::send(self::$asynCallQueue, json_encode($class));
}