本文整理匯總了PHP中CommonUtil::isCb方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonUtil::isCb方法的具體用法?PHP CommonUtil::isCb怎麽用?PHP CommonUtil::isCb使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonUtil
的用法示例。
在下文中一共展示了CommonUtil::isCb方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionTz
//.........這裏部分代碼省略.........
}
if ($posts['totleSum'] > Yii::app()->user->creditSum - Yii::app()->user->usedSum) {
echo CJSON::encode(array("msg" => "信用額度不夠", "success" => false));
Yii::app()->end();
}
$autoBhMap = array('tm' => 0, 'zm' => 1, 'zhds' => 1, 'zhdx' => 1, 'zt' => 2, 'tmds' => 3, 'tmdx' => 3, 'tmhsds' => 3, 'tmwsdx' => 3, 'tmqs' => 3, 'ztds' => 3, 'ztdx' => 3, 'zthsds' => 3, 'ztwsdx' => 3, 'ztqs' => 3, 'tmsb' => 4, 'ztsb' => 4, 'lm_0' => 5, 'lm_1' => 6, 'lm_2' => 7, 'lm_3' => 8, 'lm_4' => 9, 'tx' => 10, 'sx' => 11, 'ws' => 12, 'bbds' => 13, 'bbdx' => 13, 'mx' => 14, 'sxl' => 15, 'wsl' => 15, 'bz' => 16, 'dzy' => 17, 'qsb' => 18, 'zx_0' => 19, 'zx_1' => 19, 'zx_2' => 19, 'zx_3' => 19, 'zx_4' => 20, 'zx_5' => 20, 'qm_0' => 21, 'qm_1' => 21, 'qm_2' => 21, 'qm_3' => 21, 'qm_4' => 21, 'qm_5' => 21, 'qm_6' => 21, 'qm_7' => 21);
if ($roleid > 0) {
$sumLimitCmd = $conn->createCommand("select termLimit,betLimit,termUsed from tbl_sumlimit where idx=:idx and userid=:userid");
$updatesumLimitCmd = $conn->createCommand("update tbl_sumlimit set termUsed=termUsed+:termUsed where idx=:idx and userid=:userid");
$sumLimitMap = array();
foreach ($posts['sums'] as $key => $value) {
$typeRec = $typeRecs[$key];
$rates = array();
$termLimit = -1;
$betLimit = -1;
$termUsed = -1;
$btcid = $typeRec['btc'];
$abhIdx = $btcid == 'lm' || $btcid == 'zx' ? $autoBhMap[$key] : (substr($btcid, 0, 2) == 'zt' ? $autoBhMap[preg_replace('/[\\d\\_]/i', '', $btcid)] : $autoBhMap[$btcid]);
if ($roleid == 5) {
if (!isset($sumLimitMap[$abhIdx])) {
$sumLimitRec = $sumLimitCmd->queryRow(true, array(":idx" => $abhIdx, ":userid" => $userid));
if ($sumLimitRec != false) {
$termLimit = floatval($sumLimitRec['termLimit']);
$betLimit = floatval($sumLimitRec['betLimit']);
$termUsed = floatval($sumLimitRec['termUsed']);
$sumLimitMap[$abhIdx] = $sumLimitRec;
}
} else {
$termLimit = $sumLimitMap[$abhIdx]['termLimit'];
$betLimit = $sumLimitMap[$abhIdx]['betLimit'];
$termUsed = $sumLimitMap[$abhIdx]['termUsed'];
}
}
if (CommonUtil::isCb($typeRec['btc'])) {
$cbCodeMap = array('lm_0' => 3, 'lm_1' => 3, 'lm_2' => 2, 'lm_3' => 2, 'lm_4' => 2, 'dzy_0' => 3, 'dzy_1' => 4, 'dzy_2' => 5, 'dzy_3' => 6, 'mx_0' => 6, 'bz_0' => 5, 'sxl_0' => 2, 'sxl_1' => 2, 'sxl_2' => 3, 'sxl_3' => 3, 'sxl_4' => 4, 'sxl_5' => 4, 'wsl_0' => 2, 'wsl_1' => 2, 'wsl_2' => 3, 'wsl_3' => 3, 'wsl_4' => 4, 'wsl_5' => 4);
$cdCodeNum = array('lm' => 49, 'dzy' => 49, 'mx' => 12, 'bz' => 49, 'sxl' => 12, 'wsl' => 10);
foreach ($posts['rates'] as $rName => $rValue) {
$cbCodes = split(',', $rName);
//$a == "lm" || $a == "bz" || $a == "mx" || $a == "sxl" || $a == "wsl" || $a == "dzy";
//Ltr.lmNames = [ "三中二", "三全中", "二全中", "二中特", "特串" ];
/*Ltr.dzyNames = [ "三中一", "四中一", "五中一", "六中一" ];
mx : [ "六肖" ],
bz : [ "五不中" ],
sxl : [ "二肖連-中", "二肖連-不中", "三肖連-中", "三肖連-不中", "四肖連-中", "四肖連-不中" ],
wsl : [ "二尾連-中", "二尾連-不中", "三尾連-中", "三尾連-不中", "四尾連-中", "四尾連-不中" ],
*/
if (count($cbCodes) != $cbCodeMap[$key] || count(array_unique($cbCodes)) != count($cbCodes)) {
$msg = "{$typeRec['name']} 下注項目有誤";
break;
}
$isCbCode = true;
foreach ($cbCodes as $cbCode) {
if (!is_numeric($cbCode) || strpos($cbCode, '.') !== false || intval($cbCode) >= $cdCodeNum[$typeRec['btc']]) {
$isCbCode = false;
break;
}
}
if (!$isCbCode) {
$msg = "{$typeRec['name']} 下注項目有誤";
break;
}
$rates = split(',', $rValue);
if (floatval($typeRec['rate0' . $lei]) != floatval($rates[0])) {
$msg = "{$typeRec['name']} 賠率已變動";
break;
}