當前位置: 首頁>>代碼示例>>PHP>>正文


PHP misc::getCoachMultiplay方法代碼示例

本文整理匯總了PHP中misc::getCoachMultiplay方法的典型用法代碼示例。如果您正苦於以下問題:PHP misc::getCoachMultiplay方法的具體用法?PHP misc::getCoachMultiplay怎麽用?PHP misc::getCoachMultiplay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在misc的用法示例。


在下文中一共展示了misc::getCoachMultiplay方法的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);
        }
    }
開發者ID:rootree,項目名稱:vk-footboller-content-system,代碼行數:101,代碼來源:operations.php


注:本文中的misc::getCoachMultiplay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。