本文整理汇总了PHP中misc::getPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::getPrice方法的具体用法?PHP misc::getPrice怎么用?PHP misc::getPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类misc
的用法示例。
在下文中一共展示了misc::getPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$this->template->content = new View('operations/index');
$this->template->title = 'Доступные операции';
$this->selected_page = PAGE_OPERATIONS;
$this->selected_subpage = Operations_Controller::SUBPAGE_MAIN;
if (!$this->haveAccess()) {
return;
}
if ($_POST) {
ini_set('memory_limit', '128M');
ini_set('max_input_time', '600');
ini_set('max_execution_time', '600');
$db_pro = new Database('pro');
$db_pro->query("SET NAMES 'utf8';");
$db_pro->query("SET NAMES 'utf8' COLLATE 'utf8_general_ci'");
$db_pro->query("SET SESSION time_zone = '+3:00';");
/*
$footballersStore = $this->db->select('*')->from("footballers_store")->
orderby(array( "ft_rating" => "asc", "ft_name" => "asc"))->
where("tm_id = 41626")->get();
$this->info .= "Обработано Футболистов: " . $footballersStore->count() . $this->NL();
$orderby = 1;
foreach($footballersStore as $footballer) {
$footballer->ft_level = 6;
$price = misc::getPrice($footballer->ft_level, $footballer->ft_rating);
$multi = misc::getFootbollerMultiplay($footballer->ft_level, $footballer->ft_rating);
echo "ft_rating: " . $footballer->ft_rating . " - price1: " . $price[0] . " price2: " . $price[1] . " - multi " . $multi . "<br/>";
}
exit();
*/
$fh = fopen(ITEMS_XML, 'w') or die("can't open file");
$XML = '<?xml version="1.0" encoding="UTF-8"?>
<its>';
fwrite($fh, $this->trimNewLine($XML));
$stadiumsStore = $this->db->select('*')->from("stadiums_store")->orderby(array("st_level" => "asc", "st_name" => "asc"))->where("stadiums_store.back_up_id is null and st_status in (" . ITEM_STATUS_SENT . "," . ITEM_STATUS_NEW . "," . ITEM_STATUS_RECOMMIT . ")")->get();
$this->info .= "Обработано стадионов: " . $stadiumsStore->count() . $this->NL();
if ($stadiumsStore->count()) {
$XML = PHP_EOL . "<!-- Cтадионы -->" . PHP_EOL;
fwrite($fh, $this->trimNewLine($XML));
$orderby = 1;
foreach ($stadiumsStore as $stadium) {
$sourceFile = STORE_DISK . '/' . STORE_STADIUMS . '/' . $stadium->st_id . '.jpg';
if (!file_exists($sourceFile)) {
continue;
}
$price = misc::getStadiumPrice($stadium->st_level, $stadium->st_rating);
$multi = misc::getStadiumMultiplay($stadium->st_level, $stadium->st_rating);
$XML = ' <it id="' . $stadium->st_id . '">
<orb>' . $orderby . '</orb>
<cln>SimpleStadium</cln>
<st>Stadium</st>
<reql>' . $stadium->st_level . '</reql>
<pr>' . $price[0] . '</pr>
<rlpr>' . $price[1] . '</rlpr>
<prm>
<city>' . $this->stripE($stadium->st_city) . '</city>
<tytle>' . $this->stripE($stadium->st_name) . '</tytle>
<ccode>' . $stadium->st_country_code . '</ccode>
<daily>' . $multi . '</daily>
<rating>' . $stadium->st_rating . '</rating>
</prm>
</it>PHP_EOL' . PHP_EOL;
fwrite($fh, $this->trimNewLine($XML));
$SQL = "\nINSERT INTO item_stadiums (id, required_level, price, real_price, day_bonus)\nVALUES (" . $stadium->st_id . ", " . $stadium->st_level . ", " . $price[0] . ", " . $price[1] . " , " . $multi . ")\nON DUPLICATE KEY\nUPDATE\n required_level = " . $stadium->st_level . ",\n price = " . $price[0] . ",\n real_price = " . $price[1] . ",\n day_bonus = " . $multi . "\n";
$db_pro->query($SQL);
$status = $this->db->update('stadiums_store', array("st_status" => ITEM_STATUS_NEW), array('st_id' => $stadium->st_id));
$gameFile = STORE_GAME . '/' . STORE_GAME_STADIUMS . '/' . $stadium->st_id . '.jpg';
if (file_exists($gameFile) && filesize($gameFile) != filesize($sourceFile)) {
copy($sourceFile, $gameFile);
} elseif (!file_exists($gameFile)) {
copy($sourceFile, $gameFile);
}
$orderby++;
}
}
$sponsorsStore = $this->db->select('*')->from("sponsors_store")->orderby(array("sp_level" => "asc", "sp_rating" => "asc", "sp_name" => "asc"))->where("sponsors_store.back_up_id is null and sp_status in (" . ITEM_STATUS_SENT . "," . ITEM_STATUS_NEW . "," . ITEM_STATUS_RECOMMIT . ")")->get();
if ($sponsorsStore->count()) {
$XML = PHP_EOL . "<!-- Спонсоры -->" . PHP_EOL;
fwrite($fh, $this->trimNewLine($XML));
$orderby = 1;
$this->info .= "Обработано спонсоров: " . $sponsorsStore->count() . $this->NL();
foreach ($sponsorsStore as $sponsor) {
$sourceFile = STORE_DISK . '/' . STORE_SPONSORS . '/' . $sponsor->sp_id . '.jpg';
if (!file_exists($sourceFile) || empty($sponsor->sp_level)) {
// TODO
continue;
}
$energy = misc::getEnegry($sponsor->sp_level, $sponsor->sp_rating);
$XML = ' <it id="' . $sponsor->sp_id . '">
<orb>' . $orderby . '</orb>
<nm>' . $this->stripE($sponsor->sp_name) . '</nm>
<cln>SimpleSponsor</cln>
<reql>' . $sponsor->sp_level . '</reql>
<st>Sponsor</st>
<prm>
<energy>' . $energy . '</energy>
//.........这里部分代码省略.........