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


PHP CSaleOrder::getLocationPropertyInfo方法代碼示例

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


在下文中一共展示了CSaleOrder::getLocationPropertyInfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: parseField

 /**
  * @param $key
  *
  * @return null|string
  */
 public function parseField($key)
 {
     $output = null;
     $locationPropInfo = \CSaleOrder::getLocationPropertyInfo();
     $propIDTmp = false;
     if (strpos($key, "PROPERTY_ID_") === 0) {
         $propIDTmp = intval(substr($key, strlen("PROPERTY_ID_")));
         $this->query->addFilter('=PROPERTY.ORDER_PROPS_ID', $propIDTmp);
         if (isset($locationPropInfo['ID'][$propIDTmp])) {
             $this->addQueryAlias('PROPERTY_ID_' . $propIDTmp, 'LOCATION.ID');
         } else {
             $this->addQueryAlias('PROPERTY_ID_' . $propIDTmp, 'PROPERTY.ID');
         }
         $output = 'PROPERTY_ID_' . $propIDTmp;
     } elseif (strpos($key, "PROPERTY_ORDER_PROPS_ID_") === 0) {
         $propIDTmp = intval(substr($key, strlen("PROPERTY_ORDER_PROPS_ID_")));
         $this->query->addFilter('=PROPERTY.ORDER_PROPS_ID', $propIDTmp);
         if (isset($locationPropInfo['ID'][$propIDTmp])) {
             $this->addQueryAlias('PROPERTY_ORDER_PROPS_ID_' . $propIDTmp, 'LOCATION.ID');
         } else {
             $this->addQueryAlias('PROPERTY_ORDER_PROPS_ID_' . $propIDTmp, 'PROPERTY.ORDER_PROPS_ID');
         }
         $output = 'PROPERTY_ORDER_PROPS_ID_' . $propIDTmp;
     } elseif (strpos($key, "PROPERTY_NAME_") === 0) {
         $propIDTmp = intval(substr($key, strlen("PROPERTY_NAME_")));
         $this->addQueryAlias('PROPERTY_NAME_' . $propIDTmp, 'PROPERTY.NAME');
         $this->query->addFilter('=PROPERTY.ORDER_PROPS_ID', $propIDTmp);
         $output = 'PROPERTY_NAME_' . $propIDTmp;
     } elseif (strpos($key, "PROPERTY_VALUE_") === 0) {
         $propIDTmp = intval(substr($key, strlen("PROPERTY_VALUE_")));
         if (isset($locationPropInfo['ID'][$propIDTmp])) {
             $this->addQueryAlias('PROPERTY_ID_' . $propIDTmp, 'LOCATION.ID');
         } else {
             $this->addQueryAlias('PROPERTY_ID_' . $propIDTmp, 'PROPERTY.VALUE');
         }
         $output = 'PROPERTY_ID_' . $propIDTmp;
     } elseif (strpos($key, "PROPERTY_CODE_") === 0) {
         $propIDTmp = intval(substr($key, strlen("PROPERTY_CODE_")));
         $this->addQueryAlias('PROPERTY_CODE_' . $propIDTmp, 'PROPERTY.CODE');
         $this->query->addFilter('=PROPERTY.ORDER_PROPS_ID', $propIDTmp);
         $output = 'PROPERTY_CODE_' . $propIDTmp;
     } elseif (strpos($key, "PROPERTY_VAL_BY_CODE_") === 0) {
         $propIDTmp = preg_replace("/[^a-zA-Z0-9_-]/is", "", trim(substr($key, strlen("PROPERTY_VAL_BY_CODE_"))));
         $this->addQueryAlias('PROPERTY_VAL_BY_CODE_' . $propIDTmp, 'PROPERTY.VALUE');
         if (isset($locationPropInfo['CODE'][$propIDTmp])) {
             $this->addQueryAlias('PROPERTY_VAL_BY_CODE_' . $propIDTmp, 'LOCATION.ID');
         } else {
             $this->addQueryAlias('PROPERTY_VAL_BY_CODE_' . $propIDTmp, 'PROPERTY.VALUE');
         }
         $this->query->addFilter('=PROPERTY.CODE', $propIDTmp);
         $output = 'PROPERTY_VAL_BY_CODE_' . $propIDTmp;
     }
     if (isset($locationPropInfo['ID'][$propIDTmp])) {
         $this->query->registerRuntimeField('LOCATION', array('data_type' => '\\Bitrix\\Sale\\Location\\LocationTable', 'reference' => array('=this.PROPERTY.VALUE' => 'ref.CODE'), 'join_type' => 'inner'));
     }
     return $output;
 }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:62,代碼來源:ordercompatibility.php


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