From e13fddda752ee93631d15e7be9df715a5761943e Mon Sep 17 00:00:00 2001 From: Grisha Pomadchin Date: Tue, 17 Sep 2013 19:02:19 +0400 Subject: [PATCH] +getLocationCityId --- .../classes/general/ICrmOrderActions.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 0517e692..092f80b0 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -749,4 +749,19 @@ class ICrmOrderActions )); } } + + public static function getLocationCityId($cityName) { + if(!$cityName) + return; + + $dbLocation = CSaleLocation::GetList( + array( + "SORT" => "ASC", + "CITY_NAME_LANG" => "ASC" + ), + array("LID" => "ru", "CITY_NAME" => $cityName), false, false, array()); + + if($location = $dbLocation->Fetch()) + return $location['ID']; + } } \ No newline at end of file