本文整理汇总了PHP中Axis类的典型用法代码示例。如果您正苦于以下问题:PHP Axis类的具体用法?PHP Axis怎么用?PHP Axis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Axis类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getSaveValue
/**
*
* @param mixed $value
* @return mixed
*/
public static function getSaveValue($value)
{
if (!is_array($value)) {
return $value;
}
function remove_quotes(&$str)
{
$str = str_replace(array('"', "'"), '', $str);
}
$filename = Axis::config()->system->path . '/var/export/' . current($value);
if (@(!($fp = fopen($filename, 'r')))) {
Axis::message()->addError(Axis::translate('core')->__("Can't open file : %s", $filename));
return current($value);
}
$titles = fgetcsv($fp, 2048, ',', "'");
array_walk($titles, 'remove_quotes');
$rowSize = count($titles);
Axis::table('shippingtable_rate')->delete("site_id = " . $value['siteId']);
while (!feof($fp)) {
$data = fgetcsv($fp, 2048, ',', "'");
if (!is_array($data)) {
continue;
}
$data = array_pad($data, $rowSize, '');
array_walk($data, 'remove_quotes');
$data = array_combine($titles, $data);
Axis::table('shippingtable_rate')->insert(array('site_id' => $value['siteId'], 'country_id' => Axis::single('location/country')->getIdByIsoCode3($data['Country']), 'zone_id' => Axis::single('location/zone')->getIdByCode($data['Region/State']), 'zip' => $data['Zip'], 'value' => $data['Value'], 'price' => $data['Price']));
}
return current($value);
}
开发者ID:rommmka,项目名称:axiscommerce,代码行数:35,代码来源:ShippingTableRateImport.php
示例2: _loadCollection
/**
*
* @return array
*/
protected function _loadCollection()
{
if (empty($this->_collection)) {
$themes = Axis::model('core/option_theme');
$layouts = array();
$designPath = Axis::config('system/path') . '/app/design/front';
foreach ($themes as $theme) {
$path = $designPath . '/' . $theme . '/layouts';
if (!file_exists($path)) {
continue;
}
$dir = opendir($path);
while ($file = readdir($dir)) {
if (is_dir($path . '/' . $file) || substr($file, 0, 7) != 'layout_') {
continue;
}
$layout = substr($file, 0, -6);
if (isset($layouts[$layout])) {
$layouts[$layout]['themes'][] = $theme;
continue;
}
$layouts[$layout] = array('name' => $layout, 'themes' => array($theme));
}
}
$collection = array();
foreach ($layouts as $key => $layout) {
$collection[$key] = $layout['name'] . ' (' . implode(', ', $layout['themes']) . ')';
}
$this->_collection = $collection;
}
return $this->_collection;
}
开发者ID:baisoo,项目名称:axiscommerce,代码行数:36,代码来源:Layout.php
示例3: collect
/**
*
* @static
* @return array
*/
public static function collect()
{
if (null === self::$_collection) {
$themes = Axis_Collect_Theme::collect();
$layouts = array();
$designPath = Axis::config('system/path') . '/app/design/front';
foreach ($themes as $theme) {
$path = $designPath . '/' . $theme . '/layouts';
if (!file_exists($path)) {
continue;
}
$dir = opendir($path);
while ($file = readdir($dir)) {
if (is_dir($path . '/' . $file) || substr($file, 0, 7) != 'layout_') {
continue;
}
$layout = substr($file, 0, -6);
if (isset($layouts[$layout])) {
$layouts[$layout]['themes'][] = $theme;
continue;
}
$layouts[$layout] = array('name' => $layout, 'themes' => array($theme));
}
}
$collection = array();
foreach ($layouts as $key => $layout) {
$collection[$key] = $layout['name'] . ' (' . implode(', ', $layout['themes']) . ')';
}
self::$_collection = $collection;
}
return self::$_collection;
}
开发者ID:rommmka,项目名称:axiscommerce,代码行数:37,代码来源:Layout.php
示例4: getName
/**
*
* @static
* @param string $code
* @return string
*/
public static function getName($code)
{
if (!$code) {
return '';
}
return Axis::single('locale/currency')->getTitleByCode($code);
}
开发者ID:rguedes,项目名称:axiscommerce,代码行数:13,代码来源:Currency.php
示例5: init
public function init()
{
$categories = Axis::single('catalog/category')->select('*')->addName(Axis_Locale::getLanguageId())->addKeyWord()->order('cc.lft')->addSiteFilter(Axis::getSiteId())->addDisabledFilter()->fetchAll();
if (!is_array($this->_activeCategories)) {
$this->_activeCategories = array();
if (Zend_Registry::isRegistered('catalog/current_category')) {
$this->_activeCategories = array_keys(Zend_Registry::get('catalog/current_category')->cache()->getParentItems());
}
}
$container = $_container = new Zend_Navigation();
$lvl = 0;
$view = $this->getView();
foreach ($categories as $_category) {
$uri = $view->hurl(array('cat' => array('value' => $_category['id'], 'seo' => $_category['key_word']), 'controller' => 'catalog', 'action' => 'view'), false, true);
$class = 'nav-' . str_replace('.', '-', $_category['key_word']);
$page = new Zend_Navigation_Page_Uri(array('label' => $_category['name'], 'title' => $_category['name'], 'uri' => $uri, 'order' => $_category['lft'], 'class' => $class, 'visible' => 'enabled' === $_category['status'] ? true : false, 'active' => in_array($_category['id'], $this->_activeCategories)));
$lvl = $lvl - $_category['lvl'] + 1;
for ($i = 0; $i < $lvl; $i++) {
$_container = $_container->getParent();
}
$lvl = $_category['lvl'];
$_container->addPage($page);
$_container = $page;
}
$this->setData('menu', $container);
return true;
}
开发者ID:rguedes,项目名称:axiscommerce,代码行数:27,代码来源:Navigation.php
示例6: up
public function up()
{
$_pickup = array('RDP' => Axis_ShippingUps_Model_Option_Standard_Pickup::RDP, 'CC' => Axis_ShippingUps_Model_Option_Standard_Pickup::CC, 'OTP' => Axis_ShippingUps_Model_Option_Standard_Pickup::OTP, 'OCA' => Axis_ShippingUps_Model_Option_Standard_Pickup::OCA, 'LC' => Axis_ShippingUps_Model_Option_Standard_Pickup::LC);
$rowset = Axis::single('core/config_value')->select()->where('path = ?', 'shipping/Ups_Standard/pickup')->fetchRowset();
foreach ($rowset as $row) {
$row->value = isset($_pickup[$row->value]) ? $_pickup[$row->value] : Axis_ShippingUps_Model_Option_Standard_Pickup::CC;
$row->save();
}
///////////////////////////
$_package = array('CP' => Axis_ShippingUps_Model_Option_Standard_Package::CP, 'ULE' => Axis_ShippingUps_Model_Option_Standard_Package::ULE, 'UT' => Axis_ShippingUps_Model_Option_Standard_Package::UT, 'UEB' => Axis_ShippingUps_Model_Option_Standard_Package::UEB);
$rowset = Axis::single('core/config_value')->select()->where('path = ?', 'shipping/Ups_Standard/package')->fetchRowset();
foreach ($rowset as $row) {
$row->value = isset($_package[$row->value]) ? $_package[$row->value] : Axis_ShippingUps_Model_Option_Standard_Package::CP;
$row->save();
}
///////////////////////////
$_dest = array('RES' => Axis_ShippingUps_Model_Option_Standard_DestinationType::RES, 'COM' => Axis_ShippingUps_Model_Option_Standard_DestinationType::COM);
$rowset = Axis::single('core/config_value')->select()->where('path = ?', 'shipping/Ups_Standard/res')->fetchRowset();
foreach ($rowset as $row) {
$row->value = isset($_dest[$row->value]) ? $_dest[$row->value] : Axis_ShippingUps_Model_Option_Standard_DestinationType::RES;
$row->save();
}
///////////////////////////
$paths = array('shipping/Ups_Standard/pickup' => 'shippingUps/option_standard_pickup', 'shipping/Ups_Standard/package' => 'shippingUps/option_standard_package', 'shipping/Ups_Standard/res' => 'shippingUps/option_standard_destinationType', 'shipping/Ups_Standard/measure' => 'shippingUps/option_standard_measure', 'shipping/Ups_Standard/type' => 'shippingUps/option_standard_requestType', 'shipping/Ups_Standard/types' => 'shippingUps/option_standard_service', 'shipping/Ups_Standard/xmlOrigin' => 'shippingUps/option_standard_origin');
$rowset = Axis::single('core/config_field')->select()->fetchRowset();
foreach ($rowset as $row) {
if (isset($paths[$row->path])) {
$row->model = $paths[$row->path];
$row->save();
}
}
}
开发者ID:baisoo,项目名称:axiscommerce,代码行数:32,代码来源:0.1.3.php
示例7: postProcess
public function postProcess(Axis_Sales_Model_Order_Row $order)
{
$this->saveCreditCard($order);
$cc = $this->getCreditCard();
$options = $this->getLineItemDetails();
$billing = $order->getBilling();
$optionsAll = array_merge($options, array('STREET' => $billing->getStreetAddress(), 'ZIP' => $billing->getPostcode(), 'BUTTONSOURCE' => $this->_buttonSourceDP, 'CURRENCY' => $this->getBaseCurrencyCode(), 'IPADDRESS' => $_SERVER['REMOTE_ADDR']));
if ($cc->getCcIssueMonth() && $cc->getCcIssueYear()) {
$optionsAll['CARDSTART'] = $cc->getCcIssueMonth() . substr($cc->getCcIssueYear(), -2);
}
$optionsNVP = array('CITY' => $billing->getCity(), 'STATE' => $billing->getZone()->getCode() ? $billing->getZone()->getCode() : $billing->getCity(), 'COUNTRYCODE' => $billing->getCountry()->getIsoCode2(), 'EXPDATE' => $cc->getCcExpiresMonth() . $cc->getCcExpiresYear(), 'PAYMENTACTION' => $this->_config->paymentAction == 'Authorization' ? 'Authorization' : 'Sale');
$delivery = $order->getDelivery();
$optionsShip = array('SHIPTONAME' => $delivery->getFirstname() . ' ' . $delivery->getLastname(), 'SHIPTOSTREET' => $delivery->getStreetAddress(), 'SHIPTOSTREET2' => $delivery->getSuburb(), 'SHIPTOCITY' => $delivery->getCity(), 'SHIPTOZIP' => $delivery->getPostcode(), 'SHIPTOSTATE' => $delivery->getZone()->getCode() ? $delivery->getZone()->getCode() : $delivery->getCity(), 'SHIPTOCOUNTRYCODE' => $delivery->getCountry()->getIsoCode2());
// if these optional parameters are blank, remove them from transaction
if (isset($optionsShip['SHIPTOSTREET2']) && empty($optionsShip['SHIPTOSTREET2'])) {
unset($optionsShip['SHIPTOSTREET2']);
}
$response = $this->getApi()->DoDirectPayment(sprintf('%.2f', $this->getAmountInBaseCurrency($order->order_total)), $cc->getCcNumber(), $cc->getCcCvv(), $cc->getCcExpiresMonth() . $cc->getCcExpiresYear(), $billing->getFirstname(), $billing->getLastname(), $cc->getCcType(), $optionsAll, array_merge($optionsNVP, $optionsShip));
if ($response['ACK'] != 'Success') {
$this->log("Response : " . Zend_Debug::dump($response, null, false));
foreach ($this->getMessages($response) as $severity => $messages) {
Axis::message()->batchAdd($messages, $severity);
}
throw new Axis_Exception('DoDirectPayment Failure');
}
}
开发者ID:baisoo,项目名称:axiscommerce,代码行数:26,代码来源:Direct.php
示例8: add
/**
* Add product to order
*
* @param array $product
* @param int $orderId
* @return int orderProductId
*/
public function add($product, $orderId)
{
$stock = Axis::single('catalog/product_stock')->find($product['product_id'])->current();
$backorder = $stock->backorder;
$productVariationId = isset($product['variation_id']) ? $product['variation_id'] : null;
$stockQuantity = $stock->getQuantity($productVariationId);
if ($stockQuantity - $product['quantity'] > $stock->min_qty) {
$backorder = 0;
}
//calculate tax
$taxClassId = Axis::single('catalog/product')->getTaxClassId($product['product_id']);
$orderRow = Axis::single('sales/order')->find($orderId)->current();
$countryId = Axis::single('location/country')->getIdByName($orderRow->delivery_country);
$zoneId = 0;
if (!empty($orderRow->delivery_state)) {
$zoneId = Axis::single('location/zone')->getIdByName($orderRow->delivery_state);
}
$geozoneIds = Axis::single('location/geozone')->getIds($countryId, $zoneId);
$customerGroupId = Axis::single('account/customer')->getGroupId($orderRow->customer_id);
$productTax = Axis::single('tax/rate')->calculateByPrice($product['final_price'], $taxClassId, $geozoneIds, $customerGroupId);
$orderProductId = $this->insert(array('order_id' => $orderId, 'product_id' => $product['product_id'], 'variation_id' => $productVariationId, 'sku' => $product['sku'], 'name' => $product['name'], 'price' => $product['price'], 'tax' => $productTax, 'final_price' => $product['final_price'], 'final_weight' => $product['final_weight'], 'quantity' => $product['quantity'], 'backorder' => $backorder));
// $orderProductId = $this->getAdapter()->lastInsertId();
if (isset($product['attributes']) && is_array($product['attributes'])) {
$modelAttributte = Axis::single('sales/order_product_attribute');
foreach ($product['attributes'] as $attribute) {
$modelAttributte->insert(array('order_product_id' => $orderProductId, 'product_option' => $attribute['product_option'], 'product_option_value' => $attribute['product_option_value']));
}
}
$productRow = Axis::single('catalog/product')->find($product['product_id'])->current();
$productRow->ordered += 1;
//$product['quantity'];
$productRow->save();
return $orderProductId;
}
开发者ID:baisoo,项目名称:axiscommerce,代码行数:41,代码来源:Product.php
示例9: _beforeRender
protected function _beforeRender()
{
if (!$this->hasData('product_id')) {
return true;
}
if (!is_array($this->review_count)) {
return true;
}
/* if review already loaded */
if (in_array($this->product_id, array_keys($this->review_count))) {
return true;
}
if (!is_array($this->product_ids)) {
$this->setProductIds(array($this->product_id));
} elseif (!in_array($this->product_id, $this->getProductIds())) {
$productIds = $this->product_ids;
$productIds[] = $this->product_id;
$this->setProductIds($productIds);
}
$productIds = array_diff($this->getProductIds(), array_keys($this->review_count));
$modelCommunityReview = Axis::single('community/review');
$this->review_count += $modelCommunityReview->cache()->getCountByProductId($productIds);
$this->ratings += $modelCommunityReview->cache()->getAverageProductRating($productIds, $this->getView()->config('community/review/merge_average'));
return true;
}
开发者ID:rommmka,项目名称:axiscommerce,代码行数:25,代码来源:ReviewRating.php
示例10: removeAction
public function removeAction()
{
$data = Zend_Json::decode($this->_getParam('data'));
Axis::model('account/customer_valueSet')->delete($this->db->quoteInto('id IN (?)', $data));
Axis::message()->addSuccess(Axis::translate('admin')->__('Group was deleted successfully'));
return $this->_helper->json->sendSuccess();
}
开发者ID:rommmka,项目名称:axiscommerce,代码行数:7,代码来源:ValueSetController.php
示例11: getName
/**
*
* @static
* @param int $id
* @return string
*/
public static function getName($id)
{
if (!$id) {
return '';
}
return Axis::single('core/site')->getNameById($id);
}
开发者ID:rguedes,项目名称:axiscommerce,代码行数:13,代码来源:Site.php
示例12: __construct
public function __construct()
{
$select = Axis::model('discount/discount')->select('*');
$select->joinLeft('discount_eav', 'de.discount_id = d.id', '*')->order('d.priority DESC');
$this->_select = $select;
$this->_filters = new Axis_Object();
}
开发者ID:baisoo,项目名称:axiscommerce,代码行数:7,代码来源:Collection.php
示例13: ratings
/**
* Build rating stars, according to recieved ratings array
*
* @param array $ratings
* array(
* array(
* 'mark' => int,
* 'title' => string,
* 'product_id' => int[optional]
* ),...
* )
* @param string $url [optional]
* @param boolean $smallStars [optional]
* @return string
*/
public function ratings($ratings, $url = '', $smallStars = true)
{
if (isset($this->_config['rating_enabled']) && !$this->_config['rating_enabled']) {
return '';
}
if (!is_array($ratings)) {
$ratings = array();
}
$url = empty($url) ? '#' : $url;
$hasRating = false;
$html = '';
foreach ($ratings as $rating) {
if (!count($rating)) {
continue;
}
$hasRating = true;
$html .= '<li>';
$html .= $this->_getRatingTitle($rating['title']);
$html .= '<a href="' . $url . '" class="review-stars review-rate' . ($smallStars ? '-sm' : '') . ' "title="' . $rating['title'] . ': ' . $rating['mark'] . ' ' . Axis::translate('community')->__('stars') . '">
<span style="width: ' . $rating['mark'] * 100 / 5 . '%">' . Axis::translate('community')->__("%s stars", $rating['mark']) . '</span>
</a>';
$html .= '</li>';
}
if ($hasRating) {
$html = '<ul class="review-ratings">' . $html . '</ul>';
}
return $html;
}
开发者ID:baisoo,项目名称:axiscommerce,代码行数:43,代码来源:Ratings.php
示例14: removeAction
public function removeAction()
{
$customerGroupIds = Zend_Json::decode($this->_getParam('data'));
$isValid = true;
if (in_array(Axis_Account_Model_Customer_Group::GROUP_GUEST_ID, $customerGroupIds)) {
$isValid = false;
Axis::message()->addError(Axis::translate('admin')->__("Your can't delete default Guest group id: %s ", Axis_Account_Model_Customer_Group));
}
if (in_array(Axis_Account_Model_Customer_Group::GROUP_ALL_ID, $customerGroupIds)) {
$isValid = false;
Axis::message()->addError(Axis::translate('admin')->__("Your can't delete default All group id: %s ", Axis_Account_Model_Customer_Group::GROUP_ALL_ID));
}
if (true === in_array(Axis::config()->account->main->defaultCustomerGroup, $customerGroupIds)) {
$isValid = false;
Axis::message()->addError(Axis::translate('admin')->__("Your can't delete default customer group id: %s ", $id));
}
if (!sizeof($customerGroupIds)) {
$isValid = false;
Axis::message()->addError(Axis::translate('admin')->__('No data to delete'));
}
if ($isValid) {
Axis::single('account/customer_group')->delete($this->db->quoteInto('id IN(?)', $customerGroupIds));
Axis::message()->addSuccess(Axis::translate('admin')->__('Group was deleted successfully'));
}
$this->_helper->json->sendJson(array('success' => $isValid));
}
开发者ID:baisoo,项目名称:axiscommerce,代码行数:26,代码来源:GroupController.php
示例15: up
public function up()
{
$installer = $this->getInstaller();
$installer->run("\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('log_url')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('log_url')}` (\n `url_id` int(11) NOT NULL,\n `visitor_id` int(11) NOT NULL,\n `visit_at` datetime default NULL,\n `site_id` smallint(9) NOT NULL,\n PRIMARY KEY (`url_id`,`visitor_id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('log_url_info')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('log_url_info')}` (\n `id` mediumint(7) NOT NULL auto_increment,\n `url` varchar(255) default NULL,\n `refer` varchar(255) default NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('log_visitor')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('log_visitor')}` (\n `id` mediumint(7) unsigned NOT NULL auto_increment,\n `session_id` char(32) default NULL,\n `customer_id` int(11) default NULL,\n `last_url_id` int(11) default NULL,\n `last_visit_at` datetime default NULL,\n `site_id` smallint(9) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `UNQ_LOG_VISITOR` (`session_id`,`customer_id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('log_visitor_info')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('log_visitor_info')}` (\n `visitor_id` int(11) NOT NULL,\n `http_refer` varchar(255) default NULL,\n `user_agent` varchar(255) default NULL,\n `http_accept_charset` varchar(128) default NULL,\n `http_accept_language` varchar(128) default NULL,\n `server_addr` varchar(128) default NULL,\n `remote_addr` varchar(128) default NULL,\n PRIMARY KEY (`visitor_id`),\n KEY `fk_log_visitor_info_log_visitor` (`visitor_id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n\n ");
$this->getConfigBuilder()->section('log', 'Log')->setTranslation('Axis_Log')->section('main', 'General')->option('enabled', 'Enabled', true)->setType('radio')->setModel('core/option_boolean')->option('php', 'Php log', '/var/logs/php.log')->setDescription('Path relative to AXIS_ROOT')->option('payment', 'Payment log', '/var/logs/payment.log')->setDescription('Path relative to AXIS_ROOT')->option('shipping', 'Shipping log', '/var/logs/shipping.log')->setDescription('Path relative to AXIS_ROOT')->section('/');
Axis::single('core/page')->add('account/*/*');
}
开发者ID:baisoo,项目名称:axiscommerce,代码行数:7,代码来源:0.1.1.php
示例16: collect
/**
* @static
* @return array
*/
public static function collect()
{
if (null === self::$_collection) {
self::$_collection = Axis::single('location/country')->select(array('id', 'name'))->fetchPairs();
}
return self::$_collection;
}
开发者ID:rommmka,项目名称:axiscommerce,代码行数:11,代码来源:Country.php
示例17: _initConfig
protected function _initConfig()
{
$this->bootstrap('Loader');
$config = Zend_Registry::get('config');
Zend_Registry::set('config', new Axis_Config($config, true));
return Axis::config();
}
开发者ID:rommmka,项目名称:axiscommerce,代码行数:7,代码来源:Test.php
示例18: _beforeRender
protected function _beforeRender()
{
$visitor = Axis::model('log/visitor')->getVisitor();
// select all viewed products by current visitor
$selectInner = Axis::model('log/event')->select(array('id', 'object_id'))->order('le.id DESC');
$customerId = $visitor->customer_id;
if ($customerId && $customerId === Axis::getCustomerId()) {
$selectInner->join('log_visitor', 'le.visitor_id = lv.id')->where('lv.customer_id = ?', $customerId);
} else {
$selectInner->where('visitor_id = ?', $visitor->id);
}
// filter unique product_ids from correctly ordered query
// using adapter for specific from statement
// this subquery is used to get the correct order for products
// bigfix for not displayed product if the user viewed it some time ago and now opened it again
// with single query this product will not outputted first in a row
$adapter = Axis::model('log/event')->getAdapter();
$select = $adapter->select()->from(array('le' => $selectInner), 'object_id')->group('le.object_id')->order('le.id DESC')->limit($this->getProductsCount());
$productIds = $adapter->fetchCol($select);
if (empty($productIds)) {
return false;
}
$products = Axis::model('catalog/product')->select('*')->addFilterByAvailability()->addCommonFields()->addFinalPrice()->joinCategory()->where('cc.site_id = ?', Axis::getSiteId())->where('cp.id IN (?)', $productIds)->fetchProducts($productIds);
if (empty($products)) {
return false;
}
$this->products = $products;
return $this->hasProducts();
}
开发者ID:rguedes,项目名称:axiscommerce,代码行数:29,代码来源:RecentlyViewed.php
示例19: up
public function up()
{
$installer = $this->getInstaller();
$installer->run("\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('location_address_format')}`;\n\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('location_address_format')}` (\n `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT,\n `name` varchar(32) NOT NULL,\n `address_format` TEXT NOT NULL DEFAULT '',\n `address_summary` TEXT NOT NULL DEFAULT '',\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('location_country')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('location_country')}` (\n `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL default '',\n `iso_code_2` char(2) NOT NULL default '',\n `iso_code_3` char(3) NOT NULL default '',\n `address_format_id` smallint(5) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `LOCATION_COUNTRY_ISO2` (`iso_code_2`),\n KEY `LOCATION_COUNTRY_ISO3` (`iso_code_3`),\n KEY `LOCATION_COUNTRY_FORMAT` USING BTREE (`address_format_id`),\n CONSTRAINT `FK_LOCATION_COUNTRY_FORMAT` FOREIGN KEY (`address_format_id`)\n REFERENCES `{$installer->getTable('location_address_format')}` (`id`) ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=243 ;\n\n INSERT INTO `{$installer->getTable('location_country')}` (`id`, `name`, `iso_code_2`, `iso_code_3`, `address_format_id`) VALUES\n (0, 'ALL WORLD COUNTRY', '*', '*', 1),\n (1, 'Afghanistan', 'AF', 'AFG', 1),\n (2, 'Albania', 'AL', 'ALB', 1),\n (3, 'Algeria', 'DZ', 'DZA', 1),\n (4, 'American Samoa', 'AS', 'ASM', 1),\n (5, 'Andorra', 'AD', 'AND', 1),\n (6, 'Angola', 'AO', 'AGO', 1),\n (7, 'Anguilla', 'AI', 'AIA', 1),\n (8, 'Antarctica', 'AQ', 'ATA', 1),\n (9, 'Antigua and Barbuda', 'AG', 'ATG', 1),\n (10, 'Argentina', 'AR', 'ARG', 1),\n (11, 'Armenia', 'AM', 'ARM', 1),\n (12, 'Aruba', 'AW', 'ABW', 1),\n (13, 'Australia', 'AU', 'AUS', 1),\n (14, 'Austria', 'AT', 'AUT', 1),\n (15, 'Azerbaijan', 'AZ', 'AZE', 1),\n (16, 'Bahamas', 'BS', 'BHS', 1),\n (17, 'Bahrain', 'BH', 'BHR', 1),\n (18, 'Bangladesh', 'BD', 'BGD', 1),\n (19, 'Barbados', 'BB', 'BRB', 1),\n (20, 'Belarus', 'BY', 'BLR', 1),\n (21, 'Belgium', 'BE', 'BEL', 1),\n (22, 'Belize', 'BZ', 'BLZ', 1),\n (23, 'Benin', 'BJ', 'BEN', 1),\n (24, 'Bermuda', 'BM', 'BMU', 1),\n (25, 'Bhutan', 'BT', 'BTN', 1),\n (26, 'Bolivia', 'BO', 'BOL', 1),\n (27, 'Bosnia and Herzegowina', 'BA', 'BIH', 1),\n (28, 'Botswana', 'BW', 'BWA', 1),\n (29, 'Bouvet Island', 'BV', 'BVT', 1),\n (30, 'Brazil', 'BR', 'BRA', 1),\n (31, 'British Indian Ocean Territory', 'IO', 'IOT', 1),\n (32, 'Brunei Darussalam', 'BN', 'BRN', 1),\n (33, 'Bulgaria', 'BG', 'BGR', 1),\n (34, 'Burkina Faso', 'BF', 'BFA', 1),\n (35, 'Burundi', 'BI', 'BDI', 1),\n (36, 'Cambodia', 'KH', 'KHM', 1),\n (37, 'Cameroon', 'CM', 'CMR', 1),\n (38, 'Canada', 'CA', 'CAN', 1),\n (39, 'Cape Verde', 'CV', 'CPV', 1),\n (40, 'Cayman Islands', 'KY', 'CYM', 1),\n (41, 'Central African Republic', 'CF', 'CAF', 1),\n (42, 'Chad', 'TD', 'TCD', 1),\n (43, 'Chile', 'CL', 'CHL', 1),\n (44, 'China', 'CN', 'CHN', 1),\n (45, 'Christmas Island', 'CX', 'CXR', 1),\n (46, 'Cocos (Keeling) Islands', 'CC', 'CCK', 1),\n (47, 'Colombia', 'CO', 'COL', 1),\n (48, 'Comoros', 'KM', 'COM', 1),\n (49, 'Congo', 'CG', 'COG', 1),\n (50, 'Cook Islands', 'CK', 'COK', 1),\n (51, 'Costa Rica', 'CR', 'CRI', 1),\n (52, 'Cote D''Ivoire', 'CI', 'CIV', 1),\n (53, 'Croatia', 'HR', 'HRV', 1),\n (54, 'Cuba', 'CU', 'CUB', 1),\n (55, 'Cyprus', 'CY', 'CYP', 1),\n (56, 'Czech Republic', 'CZ', 'CZE', 1),\n (57, 'Denmark', 'DK', 'DNK', 1),\n (58, 'Djibouti', 'DJ', 'DJI', 1),\n (59, 'Dominica', 'DM', 'DMA', 1),\n (60, 'Dominican Republic', 'DO', 'DOM', 1),\n (61, 'East Timor', 'TP', 'TMP', 1),\n (62, 'Ecuador', 'EC', 'ECU', 1),\n (63, 'Egypt', 'EG', 'EGY', 1),\n (64, 'El Salvador', 'SV', 'SLV', 1),\n (65, 'Equatorial Guinea', 'GQ', 'GNQ', 1),\n (66, 'Eritrea', 'ER', 'ERI', 1),\n (67, 'Estonia', 'EE', 'EST', 1),\n (68, 'Ethiopia', 'ET', 'ETH', 1),\n (69, 'Falkland Islands (Malvinas)', 'FK', 'FLK', 1),\n (70, 'Faroe Islands', 'FO', 'FRO', 1),\n (71, 'Fiji', 'FJ', 'FJI', 1),\n (72, 'Finland', 'FI', 'FIN', 1),\n (73, 'France', 'FR', 'FRA', 1),\n (74, 'France, Metropolitan', 'FX', 'FXX', 1),\n (75, 'French Guiana', 'GF', 'GUF', 1),\n (76, 'French Polynesia', 'PF', 'PYF', 1),\n (77, 'French Southern Territories', 'TF', 'ATF', 1),\n (78, 'Gabon', 'GA', 'GAB', 1),\n (79, 'Gambia', 'GM', 'GMB', 1),\n (80, 'Georgia', 'GE', 'GEO', 1),\n (81, 'Germany', 'DE', 'DEU', 1),\n (82, 'Ghana', 'GH', 'GHA', 1),\n (83, 'Gibraltar', 'GI', 'GIB', 1),\n (84, 'Greece', 'GR', 'GRC', 1),\n (85, 'Greenland', 'GL', 'GRL', 1),\n (86, 'Grenada', 'GD', 'GRD', 1),\n (87, 'Guadeloupe', 'GP', 'GLP', 1),\n (88, 'Guam', 'GU', 'GUM', 1),\n (89, 'Guatemala', 'GT', 'GTM', 1),\n (90, 'Guinea', 'GN', 'GIN', 1),\n (91, 'Guinea-bissau', 'GW', 'GNB', 1),\n (92, 'Guyana', 'GY', 'GUY', 1),\n (93, 'Haiti', 'HT', 'HTI', 1),\n (94, 'Heard and Mc Donald Islands', 'HM', 'HMD', 1),\n (95, 'Honduras', 'HN', 'HND', 1),\n (96, 'Hong Kong', 'HK', 'HKG', 1),\n (97, 'Hungary', 'HU', 'HUN', 1),\n (98, 'Iceland', 'IS', 'ISL', 1),\n (99, 'India', 'IN', 'IND', 1),\n (100, 'Indonesia', 'ID', 'IDN', 1),\n (101, 'Iran (Islamic Republic of)', 'IR', 'IRN', 1),\n (102, 'Iraq', 'IQ', 'IRQ', 1),\n (103, 'Ireland', 'IE', 'IRL', 1),\n (104, 'Israel', 'IL', 'ISR', 1),\n (105, 'Italy', 'IT', 'ITA', 1),\n (106, 'Jamaica', 'JM', 'JAM', 1),\n (107, 'Japan', 'JP', 'JPN', 1),\n (108, 'Jordan', 'JO', 'JOR', 1),\n (109, 'Kazakhstan', 'KZ', 'KAZ', 1),\n (110, 'Kenya', 'KE', 'KEN', 1),\n (111, 'Kiribati', 'KI', 'KIR', 1),\n (112, 'Korea, Democratic People''s Republic of', 'KP', 'PRK', 1),\n (113, 'Korea, Republic of', 'KR', 'KOR', 1),\n (114, 'Kuwait', 'KW', 'KWT', 1),\n (115, 'Kyrgyzstan', 'KG', 'KGZ', 1),\n (116, 'Lao People''s Democratic Republic', 'LA', 'LAO', 1),\n (117, 'Latvia', 'LV', 'LVA', 1),\n (118, 'Lebanon', 'LB', 'LBN', 1),\n (119, 'Lesotho', 'LS', 'LSO', 1),\n (120, 'Liberia', 'LR', 'LBR', 1),\n (121, 'Libyan Arab Jamahiriya', 'LY', 'LBY', 1),\n (122, 'Liechtenstein', 'LI', 'LIE', 1),\n (123, 'Lithuania', 'LT', 'LTU', 1),\n (124, 'Luxembourg', 'LU', 'LUX', 1),\n (125, 'Macau', 'MO', 'MAC', 1),\n (126, 'Macedonia, The Former Yugoslav Republic of', 'MK', 'MKD', 1),\n (127, 'Madagascar', 'MG', 'MDG', 1),\n (128, 'Malawi', 'MW', 'MWI', 1),\n (129, 'Malaysia', 'MY', 'MYS', 1),\n (130, 'Maldives', 'MV', 'MDV', 1),\n (131, 'Mali', 'ML', 'MLI', 1),\n (132, 'Malta', 'MT', 'MLT', 1),\n (133, 'Marshall Islands', 'MH', 'MHL', 1),\n (134, 'Martinique', 'MQ', 'MTQ', 1),\n (135, 'Mauritania', 'MR', 'MRT', 1),\n (136, 'Mauritius', 'MU', 'MUS', 1),\n (137, 'Mayotte', 'YT', 'MYT', 1),\n (138, 'Mexico', 'MX', 'MEX', 1),\n (139, 'Micronesia, Federated States of', 'FM', 'FSM', 1),\n (140, 'Moldova, Republic of', 'MD', 'MDA', 1),\n (141, 'Monaco', 'MC', 'MCO', 1),\n (142, 'Mongolia', 'MN', 'MNG', 1),\n (143, 'Montserrat', 'MS', 'MSR', 1),\n (144, 'Morocco', 'MA', 'MAR', 1),\n (145, 'Mozambique', 'MZ', 'MOZ', 1),\n (146, 'Myanmar', 'MM', 'MMR', 1),\n (147, 'Namibia', 'NA', 'NAM', 1),\n (148, 'Nauru', 'NR', 'NRU', 1),\n (149, 'Nepal', 'NP', 'NPL', 1),\n (150, 'Netherlands', 'NL', 'NLD', 1),\n (151, 'Netherlands Antilles', 'AN', 'ANT', 1),\n (152, 'New Caledonia', 'NC', 'NCL', 1),\n (153, 'New Zealand', 'NZ', 'NZL', 1),\n (154, 'Nicaragua', 'NI', 'NIC', 1),\n (155, 'Niger', 'NE', 'NER', 1),\n (156, 'Nigeria', 'NG', 'NGA', 1),\n (157, 'Niue', 'NU', 'NIU', 1),\n (158, 'Norfolk Island', 'NF', 'NFK', 1),\n (159, 'Northern Mariana Islands', 'MP', 'MNP', 1),\n (160, 'Norway', 'NO', 'NOR', 1),\n (161, 'Oman', 'OM', 'OMN', 1),\n (162, 'Pakistan', 'PK', 'PAK', 1),\n (163, 'Palau', 'PW', 'PLW', 1),\n (164, 'Panama', 'PA', 'PAN', 1),\n (165, 'Papua New Guinea', 'PG', 'PNG', 1),\n (166, 'Paraguay', 'PY', 'PRY', 1),\n (167, 'Peru', 'PE', 'PER', 1),\n (168, 'Philippines', 'PH', 'PHL', 1),\n (169, 'Pitcairn', 'PN', 'PCN', 1),\n (170, 'Poland', 'PL', 'POL', 1),\n (171, 'Portugal', 'PT', 'PRT', 1),\n (172, 'Puerto Rico', 'PR', 'PRI', 1),\n (173, 'Qatar', 'QA', 'QAT', 1),\n (174, 'Reunion', 'RE', 'REU', 1),\n (175, 'Romania', 'RO', 'ROM', 1),\n (176, 'Russian Federation', 'RU', 'RUS', 1),\n (177, 'Rwanda', 'RW', 'RWA', 1),\n (178, 'Saint Kitts and Nevis', 'KN', 'KNA', 1),\n (179, 'Saint Lucia', 'LC', 'LCA', 1),\n (180, 'Saint Vincent and the Grenadines', 'VC', 'VCT', 1),\n (181, 'Samoa', 'WS', 'WSM', 1),\n (182, 'San Marino', 'SM', 'SMR', 1),\n (183, 'Sao Tome and Principe', 'ST', 'STP', 1),\n (184, 'Saudi Arabia', 'SA', 'SAU', 1),\n (185, 'Senegal', 'SN', 'SEN', 1),\n (186, 'Seychelles', 'SC', 'SYC', 1),\n (187, 'Sierra Leone', 'SL', 'SLE', 1),\n (188, 'Singapore', 'SG', 'SGP', 1),\n (189, 'Slovakia (Slovak Republic)', 'SK', 'SVK', 1),\n (190, 'Slovenia', 'SI', 'SVN', 1),\n (191, 'Solomon Islands', 'SB', 'SLB', 1),\n (192, 'Somalia', 'SO', 'SOM', 1),\n (193, 'South Africa', 'ZA', 'ZAF', 1),\n (194, 'South Georgia and the South Sandwich Islands', 'GS', 'SGS', 1),\n (195, 'Spain', 'ES', 'ESP', 1),\n (196, 'Sri Lanka', 'LK', 'LKA', 1),\n (197, 'St. Helena', 'SH', 'SHN', 1),\n (198, 'St. Pierre and Miquelon', 'PM', 'SPM', 1),\n (199, 'Sudan', 'SD', 'SDN', 1),\n (200, 'Suriname', 'SR', 'SUR', 1),\n (201, 'Svalbard and Jan Mayen Islands', 'SJ', 'SJM', 1),\n (202, 'Swaziland', 'SZ', 'SWZ', 1),\n (203, 'Sweden', 'SE', 'SWE', 1),\n (204, 'Switzerland', 'CH', 'CHE', 1),\n (205, 'Syrian Arab Republic', 'SY', 'SYR', 1),\n (206, 'Taiwan', 'TW', 'TWN', 1),\n (207, 'Tajikistan', 'TJ', 'TJK', 1),\n (208, 'Tanzania, United Republic of', 'TZ', 'TZA', 1),\n (209, 'Thailand', 'TH', 'THA', 1),\n (210, 'Togo', 'TG', 'TGO', 1),\n (211, 'Tokelau', 'TK', 'TKL', 1),\n (212, 'Tonga', 'TO', 'TON', 1),\n (213, 'Trinidad and Tobago', 'TT', 'TTO', 1),\n (214, 'Tunisia', 'TN', 'TUN', 1),\n (215, 'Turkey', 'TR', 'TUR', 1),\n (216, 'Turkmenistan', 'TM', 'TKM', 1),\n (217, 'Turks and Caicos Islands', 'TC', 'TCA', 1),\n (218, 'Tuvalu', 'TV', 'TUV', 1),\n (219, 'Uganda', 'UG', 'UGA', 1),\n (220, 'Ukraine', 'UA', 'UKR', 1),\n (221, 'United Arab Emirates', 'AE', 'ARE', 1),\n (222, 'United Kingdom', 'GB', 'GBR', 1),\n (223, 'United States', 'US', 'USA', 1),\n (224, 'United States Minor Outlying Islands', 'UM', 'UMI', 1),\n (225, 'Uruguay', 'UY', 'URY', 1),\n (226, 'Uzbekistan', 'UZ', 'UZB', 1),\n (227, 'Vanuatu', 'VU', 'VUT', 1),\n (228, 'Vatican City State (Holy See)', 'VA', 'VAT', 1),\n (229, 'Venezuela', 'VE', 'VEN', 1),\n (230, 'Viet Nam', 'VN', 'VNM', 1),\n (231, 'Virgin Islands (British)', 'VG', 'VGB', 1),\n (232, 'Virgin Islands (U.S.)', 'VI', 'VIR', 1),\n (233, 'Wallis and Futuna Islands', 'WF', 'WLF', 1),\n (234, 'Western Sahara', 'EH', 'ESH', 1),\n (235, 'Yemen', 'YE', 'YEM', 1),\n (236, 'Yugoslavia', 'YU', 'YUG', 1),\n (237, 'Zaire', 'ZR', 'ZAR', 1),\n (238, 'Zambia', 'ZM', 'ZMB', 1),\n (239, 'Zimbabwe', 'ZW', 'ZWE', 1),\n (240, 'Aaland Islands', 'AX', 'ALA', 1);\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('location_geozone')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('location_geozone')}` (\n `id` mediumint(8) unsigned NOT NULL auto_increment,\n `name` varchar(128) NOT NULL,\n `description` text,\n `priority` mediumint(8) NOT NULL,\n `created_on` datetime NOT NULL,\n `modified_on` datetime default NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `priority` (`priority`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\n\n INSERT INTO `{$installer->getTable('location_geozone')}` (`id`, `name`, `description`, `priority`) VALUES (1, 'ALL', 'ALL WORLD', 1),(2, 'USA', 'United State of America', 5);\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('location_geozone_zone')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('location_geozone_zone')}` (\n `id` int(10) unsigned NOT NULL auto_increment,\n `geozone_id` mediumint(8) unsigned NOT NULL,\n `zone_id` mediumint(8) unsigned default NULL,\n `created_on` datetime NOT NULL,\n `modified_on` datetime default NULL,\n `country_id` mediumint(8) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `FK_LOCATION_GEOZONE_ZONE_ZONE` (`zone_id`),\n KEY `FK_LOCATION_GEOZONE_ZONE_COUNTRY` (`country_id`),\n
|
请发表评论