本文整理汇总了PHP中misc::getPriceCoach方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::getPriceCoach方法的具体用法?PHP misc::getPriceCoach怎么用?PHP misc::getPriceCoach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类misc
的用法示例。
在下文中一共展示了misc::getPriceCoach方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
//.........这里部分代码省略.........
}
$footballer->ft_level = $teamStoreFile[$footballer->tm_id]->cp_level;
$sourceFileBest = STORE_DISK . '/' . STORE_BEST . '/' . $footballer->ft_id . '.jpg';
$sourceFile = STORE_DISK . '/' . STORE_AVATARS . '/' . $footballer->ft_id . '.jpg';
if (!file_exists($sourceFile) || !file_exists($sourceFileBest)) {
continue;
}
$price = misc::getPrice($footballer->ft_level, $footballer->ft_rating);
print_r($price);
echo "<br/>" . $footballer->ft_level . " - " . $footballer->ft_rating . "<br/>";
$multi = misc::getFootbollerMultiplay($footballer->ft_level, $footballer->ft_rating);
$XML = ' <it id="' . $footballer->ft_id . '">
<orb>' . $orderby . '</orb>
<his>0</his>
<nm>' . $this->stripE($footballer->ft_name) . '</nm>
<pr>' . $price[0] . '</pr>
<rlpr>' . $price[1] . '</rlpr>
<reql>' . $footballer->ft_level . '</reql>
<cln>SimpleFootballer</cln>
<st>' . $this->getStringStatus($footballer->ft_line) . '</st>
<prm>
<level>' . $multi . '</level>
<team>' . $footballer->tm_id . '</team>
<year>' . $footballer->ft_year . '</year>
</prm>
</it>PHP_EOL' . PHP_EOL;
fwrite($fh, $this->trimNewLine($XML));
$SQL = "\nINSERT INTO item_footballers (id, required_level, price, real_price, param_level, line)\nVALUES (" . $footballer->ft_id . ", " . $footballer->ft_level . ", " . $price[0] . ", " . $price[1] . " , " . $multi . ", " . $footballer->ft_line . ")\nON DUPLICATE KEY\nUPDATE\n required_level = " . $footballer->ft_level . ",\n price = " . $price[0] . ",\n real_price = " . $price[1] . ",\n param_level = " . $multi . ",\n line = " . $footballer->ft_line . "\n";
$db_pro->query($SQL);
$status = $this->db->update('footballers_store', array("ft_status" => ITEM_STATUS_NEW), array('ft_id' => $footballer->ft_id));
$gameFile = STORE_GAME . '/' . STORE_GAME_AVATARS . '/' . $footballer->ft_id . '.jpg';
if (file_exists($gameFile) && filesize($gameFile) != filesize($sourceFile)) {
copy($sourceFile, $gameFile);
} elseif (!file_exists($gameFile)) {
copy($sourceFile, $gameFile);
}
$gameFile = STORE_GAME . '/' . STORE_GAME_BEST . '/' . $footballer->ft_id . '.jpg';
if (file_exists($gameFile) && filesize($gameFile) != filesize($sourceFileBest)) {
copy($sourceFileBest, $gameFile);
} elseif (!file_exists($gameFile)) {
copy($sourceFileBest, $gameFile);
}
$orderby++;
}
}
//exit();
$coachesStore = $this->db->select('*')->from("coaches_store")->orderby(array("ch_rating" => "asc", "ch_name" => "asc"))->where("coaches_store.back_up_id is null and ch_status in (" . ITEM_STATUS_NEW . "," . ITEM_STATUS_NEW . "," . ITEM_STATUS_RECOMMIT . ")")->get();
$this->info .= "Обработано тренеров: " . $coachesStore->count() . $this->NL();
if ($coachesStore->count()) {
$XML = PHP_EOL . "<!-- Тренера -->" . PHP_EOL;
fwrite($fh, $this->trimNewLine($XML));
$orderby = 1;
foreach ($coachesStore as $coach) {
$sourceFile = STORE_DISK . '/' . STORE_COACHES . '/' . $coach->ch_id . '.jpg';
if (!file_exists($sourceFile)) {
continue;
}
if (!isset($teamStoreFile[$coach->tm_id])) {
continue;
}
$coach->ch_level = $teamStoreFile[$coach->tm_id]->cp_level;
$price = misc::getPriceCoach($coach->ch_level, $coach->ch_rating);
$multi = misc::getCoachMultiplay($coach->ch_level, $coach->ch_rating);
$XML = ' <it id="' . $coach->ch_id . '">
<orb>' . $orderby . '</orb>
<his>0</his>
<nm>' . $this->stripE($coach->ch_name) . '</nm>
<pr>' . $price[0] . '</pr>
<rlpr>' . $price[1] . '</rlpr>
<reql>' . $coach->ch_level . '</reql>
<cln>SimpleFootballer</cln>
<st>teamlead</st>
<prm>
<studyRate>' . $multi . '</studyRate>
<team>' . $coach->tm_id . '</team>
</prm>
</it>PHP_EOL' . PHP_EOL;
fwrite($fh, $this->trimNewLine($XML));
if ($coach->ch_status == ITEM_STATUS_SENT) {
$status = $db_pro->insert('item_teamleads', array("id" => $coach->ch_id, "required_level" => $coach->ch_level, "price" => $price[0], "real_price" => $price[1], "param_study_rate" => $multi));
} else {
$status = $db_pro->update('item_teamleads', array("required_level" => $coach->ch_level, "price" => $price[0], "real_price" => $price[1], "param_study_rate" => $multi), array('id' => $coach->ch_id));
}
$SQL = "\nINSERT INTO item_teamleads (id, required_level, price, real_price, param_study_rate)\nVALUES (" . $coach->ch_id . ", " . $coach->ch_level . ", " . $price[0] . ", " . $price[1] . " , " . $multi . ")\nON DUPLICATE KEY\nUPDATE\n required_level = " . $coach->ch_level . ",\n price = " . $price[0] . ",\n real_price = " . $price[1] . ",\n param_study_rate = " . $multi . "\n";
$db_pro->query($SQL);
$status = $this->db->update('coaches_store', array("ch_status" => ITEM_STATUS_NEW), array('ch_id' => $coach->ch_id));
$gameFile = STORE_GAME . '/' . STORE_GAME_COACHES . '/' . $coach->ch_id . '.jpg';
if (file_exists($gameFile) && filesize($gameFile) != filesize($sourceFile)) {
copy($sourceFile, $gameFile);
} elseif (!file_exists($gameFile)) {
copy($sourceFile, $gameFile);
}
$orderby++;
}
}
$XML = "</its>";
fwrite($fh, $this->trimNewLine($XML));
fclose($fh);
}
}