本文整理汇总了PHP中CSalePaySystemAction::checkRestriction方法的典型用法代码示例。如果您正苦于以下问题:PHP CSalePaySystemAction::checkRestriction方法的具体用法?PHP CSalePaySystemAction::checkRestriction怎么用?PHP CSalePaySystemAction::checkRestriction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSalePaySystemAction
的用法示例。
在下文中一共展示了CSalePaySystemAction::checkRestriction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetList
public static function GetList($arOrder = array("SORT" => "ASC", "NAME" => "ASC"), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
{
if (array_key_exists("PSA_PERSON_TYPE_ID", $arFilter)) {
$arFilter['PERSON_TYPE_ID'] = $arFilter['PSA_PERSON_TYPE_ID'];
unset($arFilter["PSA_PERSON_TYPE_ID"]);
}
$salePaySystemFields = array('ID', 'NAME', 'ACTIVE', 'SORT', 'DESCRIPTION');
$ignoredFields = array('LID', 'CURRENCY', 'PERSON_TYPE_ID');
if (!$arSelectFields) {
$select = array('ID', 'NAME', 'ACTIVE', 'SORT', 'DESCRIPTION');
} else {
$select = array();
foreach ($arSelectFields as $key => $field) {
if (in_array($field, $ignoredFields)) {
continue;
}
$select[$key] = self::getAlias($field);
}
}
$filter = array();
foreach ($arFilter as $key => $value) {
if (in_array($key, $ignoredFields)) {
continue;
}
$filter[self::getAlias($key)] = $value;
}
if (isset($arFilter['PERSON_TYPE_ID'])) {
$select = array_merge($select, array('PSA_ID' => 'ID', 'PSA_NAME', 'ACTION_FILE', 'RESULT_FILE', 'NEW_WINDOW', 'PERSON_TYPE_ID', 'PARAMS', 'TARIF', 'HAVE_PAYMENT', 'HAVE_ACTION', 'HAVE_RESULT', 'HAVE_PREPAY', 'HAVE_RESULT_RECEIVE', 'ENCODING', 'LOGOTIP'));
}
if (in_array('PARAMS', $select) && !array_key_exists('PSA_ID', $select)) {
$select['PSA_ID'] = 'ID';
}
if (in_array('PARAMS', $select) && !in_array('PERSON_TYPE_ID', $select)) {
$select[] = 'PERSON_TYPE_ID';
}
$order = array();
foreach ($arOrder as $key => $value) {
$order[self::getAlias($key)] = $value;
}
$groupBy = array();
if ($arGroupBy !== false) {
$arGroupBy = !is_array($arGroupBy) ? array($arGroupBy) : $arGroupBy;
foreach ($arGroupBy as $key => $value) {
$groupBy[$key] = self::getAlias($value);
}
}
$dbRes = PaySystemActionTable::getList(array('select' => $select, 'filter' => $filter, 'order' => $order, 'group' => $groupBy));
$limit = null;
if (is_array($arNavStartParams) && isset($arNavStartParams['nTopCount'])) {
if ($arNavStartParams['nTopCount'] > 0) {
$limit = $arNavStartParams['nTopCount'];
}
}
$result = array();
while ($data = $dbRes->fetch()) {
if ($limit !== null && !$limit) {
break;
}
$dbRestriction = \Bitrix\Sale\Internals\ServiceRestrictionTable::getList(array('filter' => array('SERVICE_ID' => $data['ID'], 'SERVICE_TYPE' => \Bitrix\Sale\Services\PaySystem\Restrictions\Manager::SERVICE_TYPE_PAYMENT)));
while ($restriction = $dbRestriction->fetch()) {
if (!CSalePaySystemAction::checkRestriction($restriction, $arFilter)) {
continue 2;
}
}
if (isset($data['ACTION_FILE'])) {
$oldHandler = array_search($data['ACTION_FILE'], CSalePaySystemAction::getOldToNewHandlersMap());
if ($oldHandler !== false) {
$data['ACTION_FILE'] = $oldHandler;
}
}
if (array_key_exists('PARAMS', $data)) {
$params = CSalePaySystemAction::getParamsByConsumer('PAYSYSTEM_' . $data['PSA_ID'], $data['PERSON_TYPE_ID']);
$params['BX_PAY_SYSTEM_ID'] = array('TYPE' => '', 'VALUE' => $data['PSA_ID']);
$data['PARAMS'] = serialize($params);
}
foreach ($data as $key => $value) {
if (!in_array($key, $salePaySystemFields)) {
$newKey = self::getAliasBack($key);
if ($newKey != $key) {
$data[$newKey] = $value;
unset($data[$key]);
}
}
}
$result[] = $data;
$limit--;
}
$dbRes = new \CDBResult();
$dbRes->InitFromArray($result);
return $dbRes;
}
示例2: array
break;
}
}
}
$params = array('select' => array('ID', 'NAME', 'SORT', 'DESCRIPTION', 'ACTIVE', 'ACTION_FILE', 'LOGOTIP'), 'filter' => $filter);
if (ToUpper($by) != 'LID' && ToUpper($by) != 'CURRENCY') {
$params['order'] = array(ToUpper($by) => ToUpper($order));
}
$dbRes = \Bitrix\Sale\Internals\PaySystemActionTable::getList($params);
$result = array();
while ($paySystem = $dbRes->fetch()) {
if (!empty($filter_person_type) && !in_array("NOT_REF", $filter_person_type)) {
$filter_person_type['PERSON_TYPE_ID'] = $filter_person_type;
$dbRestriction = \Bitrix\Sale\Internals\ServiceRestrictionTable::getList(array('filter' => array('SERVICE_ID' => $paySystem['ID'], 'SERVICE_TYPE' => \Bitrix\Sale\Services\PaySystem\Restrictions\Manager::SERVICE_TYPE_PAYMENT, '=CLASS_NAME' => '\\Bitrix\\Sale\\Services\\PaySystem\\Restrictions\\PersonType')));
while ($restriction = $dbRestriction->fetch()) {
if (!CSalePaySystemAction::checkRestriction($restriction, $filter_person_type)) {
continue 2;
}
}
}
$result[] = $paySystem;
}
$dbRes = new CDBResult();
$dbRes->InitFromArray($result);
$dbRes = new CAdminResult($dbRes, $sTableID);
$dbRes->NavStart();
$lAdmin->NavText($dbRes->GetNavPrint(GetMessage("SALE_PRLIST")));
$lAdmin->AddHeaders(array(array("id" => "SORT", "content" => GetMessage("SALE_SORT"), "sort" => "SORT", "default" => true), array("id" => "NAME", "content" => GetMessage("SALE_NAME"), "sort" => "NAME", "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage("SALE_H_DESCRIPTION"), "default" => true), array("id" => "LOGOTIP", "content" => GetMessage("SALE_LOGOTIP"), "default" => true), array("id" => "ACTIVE", "content" => GetMessage("SALE_ACTIVE"), "sort" => "ACTIVE", "default" => true), array("id" => "PERSON_TYPES", "content" => GetMessage("SALE_H_PERSON_TYPES"), "default" => false), array("id" => "LID", "content" => GetMessage('SALE_LID'), "default" => false), array("id" => "ACTION_FILES", "content" => GetMessage("SALE_H_ACTION_FILES"), "default" => false), array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true)));
$arVisibleColumns = $lAdmin->GetVisibleHeaderColumns();
while ($arCCard = $dbRes->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arCCard, "sale_pay_system_edit.php?ID=" . $f_ID . "&lang=" . LANG, GetMessage("SALE_EDIT_DESCR"));