当前位置: 首页>>代码示例>>PHP>>正文


PHP Model\OrderQuery类代码示例

本文整理汇总了PHP中Thelia\Model\OrderQuery的典型用法代码示例。如果您正苦于以下问题:PHP OrderQuery类的具体用法?PHP OrderQuery怎么用?PHP OrderQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OrderQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parseResults

 public function parseResults(LoopResult $loopResult)
 {
     $this->container->get('thelia.condition.factory');
     if (null !== ($order = OrderQuery::create()->findPk($this->getOrder()))) {
         $oneDayInSeconds = 86400;
         /** @var \Thelia\Model\OrderCoupon $orderCoupon */
         foreach ($loopResult->getResultDataCollection() as $orderCoupon) {
             $loopResultRow = new LoopResultRow($orderCoupon);
             $now = time();
             $datediff = $orderCoupon->getExpirationDate()->getTimestamp() - $now;
             $daysLeftBeforeExpiration = floor($datediff / $oneDayInSeconds);
             $freeShippingForCountriesIds = [];
             /** @var OrderCouponCountry $couponCountry */
             foreach ($orderCoupon->getFreeShippingForCountries() as $couponCountry) {
                 $freeShippingForCountriesIds[] = $couponCountry->getCountryId();
             }
             $freeShippingForModulesIds = [];
             /** @var OrderCouponModule $couponModule */
             foreach ($orderCoupon->getFreeShippingForModules() as $couponModule) {
                 $freeShippingForModulesIds[] = $couponModule->getModuleId();
             }
             $loopResultRow->set("ID", $orderCoupon->getId())->set("CODE", $orderCoupon->getCode())->set("DISCOUNT_AMOUNT", $orderCoupon->getAmount())->set("TITLE", $orderCoupon->getTitle())->set("SHORT_DESCRIPTION", $orderCoupon->getShortDescription())->set("DESCRIPTION", $orderCoupon->getDescription())->set("EXPIRATION_DATE", $orderCoupon->getExpirationDate($order->getLangId()))->set("IS_CUMULATIVE", $orderCoupon->getIsCumulative())->set("IS_REMOVING_POSTAGE", $orderCoupon->getIsRemovingPostage())->set("IS_AVAILABLE_ON_SPECIAL_OFFERS", $orderCoupon->getIsAvailableOnSpecialOffers())->set("DAY_LEFT_BEFORE_EXPIRATION", $daysLeftBeforeExpiration)->set("FREE_SHIPPING_FOR_COUNTRIES_LIST", implode(',', $freeShippingForCountriesIds))->set("FREE_SHIPPING_FOR_MODULES_LIST", implode(',', $freeShippingForModulesIds))->set("PER_CUSTOMER_USAGE_COUNT", $orderCoupon->getPerCustomerUsageCount())->set("IS_USAGE_CANCELED", $orderCoupon->getUsageCanceled());
             $this->addOutputFields($loopResultRow, $orderCoupon);
             $loopResult->addRow($loopResultRow);
         }
     }
     return $loopResult;
 }
开发者ID:vigourouxjulien,项目名称:thelia,代码行数:28,代码来源:OrderCoupon.php

示例2: current

 public function current()
 {
     do {
         $order = parent::current();
         $getNext = false;
         if ($this->rangeDate !== null && ($order[OrderTableMap::CREATED_AT] < $this->rangeDate['start'] || $order[OrderTableMap::CREATED_AT] > $this->rangeDate['end'])) {
             $this->next();
             $getNext = true;
         }
     } while ($getNext && $this->valid());
     $locale = $this->language->getLocale();
     $query = OrderQuery::create()->useCurrencyQuery()->addAsColumn('currency_CODE', CurrencyTableMap::CODE)->endUse()->useCustomerQuery()->addAsColumn('customer_REF', CustomerTableMap::REF)->endUse()->useOrderProductQuery()->useOrderProductTaxQuery(null, Criteria::LEFT_JOIN)->addAsColumn('product_TAX', 'IF(' . OrderProductTableMap::WAS_IN_PROMO . ',' . 'SUM(' . OrderProductTaxTableMap::PROMO_AMOUNT . '),' . 'SUM(' . OrderProductTaxTableMap::AMOUNT . ')' . ')')->addAsColumn('tax_TITLE', OrderProductTableMap::TAX_RULE_TITLE)->endUse()->addAsColumn('product_TITLE', OrderProductTableMap::TITLE)->addAsColumn('product_PRICE', 'IF(' . OrderProductTableMap::WAS_IN_PROMO . ',' . OrderProductTableMap::PROMO_PRICE . ',' . OrderProductTableMap::PRICE . ')')->addAsColumn('product_QUANTITY', OrderProductTableMap::QUANTITY)->addAsColumn('product_WAS_IN_PROMO', OrderProductTableMap::WAS_IN_PROMO)->groupById()->endUse()->orderById()->groupById()->useOrderCouponQuery(null, Criteria::LEFT_JOIN)->addAsColumn('coupon_COUPONS', 'GROUP_CONCAT(' . OrderCouponTableMap::TITLE . ')')->groupBy(OrderCouponTableMap::ORDER_ID)->endUse()->useModuleRelatedByPaymentModuleIdQuery('payment_module')->addAsColumn('payment_module_TITLE', '`payment_module`.CODE')->endUse()->useModuleRelatedByDeliveryModuleIdQuery('delivery_module')->addAsColumn('delivery_module_TITLE', '`delivery_module`.CODE')->endUse()->useOrderAddressRelatedByDeliveryOrderAddressIdQuery('delivery_address_join')->useCustomerTitleQuery('delivery_address_customer_title_join')->useCustomerTitleI18nQuery('delivery_address_customer_title_i18n_join')->addAsColumn('delivery_address_TITLE', '`delivery_address_customer_title_i18n_join`.SHORT')->endUse()->endUse()->useCountryQuery('delivery_address_country_join')->useCountryI18nQuery('delivery_address_country_i18n_join')->addAsColumn('delivery_address_country_TITLE', '`delivery_address_country_i18n_join`.TITLE')->endUse()->addAsColumn('delivery_address_COMPANY', '`delivery_address_join`.COMPANY')->addAsColumn('delivery_address_FIRSTNAME', '`delivery_address_join`.FIRSTNAME')->addAsColumn('delivery_address_LASTNAME', '`delivery_address_join`.LASTNAME')->addAsColumn('delivery_address_ADDRESS1', '`delivery_address_join`.ADDRESS1')->addAsColumn('delivery_address_ADDRESS2', '`delivery_address_join`.ADDRESS2')->addAsColumn('delivery_address_ADDRESS3', '`delivery_address_join`.ADDRESS3')->addAsColumn('delivery_address_ZIPCODE', '`delivery_address_join`.ZIPCODE')->addAsColumn('delivery_address_CITY', '`delivery_address_join`.CITY')->addAsColumn('delivery_address_PHONE', '`delivery_address_join`.PHONE')->endUse()->endUse()->useOrderAddressRelatedByInvoiceOrderAddressIdQuery('invoice_address_join')->useCustomerTitleQuery('invoice_address_customer_title_join')->useCustomerTitleI18nQuery('invoice_address_customer_title_i18n_join')->addAsColumn('invoice_address_TITLE', '`invoice_address_customer_title_i18n_join`.SHORT')->endUse()->endUse()->useCountryQuery('invoice_address_country_join')->useCountryI18nQuery('invoice_address_country_i18n_join')->addAsColumn('invoice_address_country_TITLE', '`invoice_address_country_i18n_join`.TITLE')->endUse()->endUse()->addAsColumn('invoice_address_COMPANY', '`invoice_address_join`.COMPANY')->addAsColumn('invoice_address_FIRSTNAME', '`invoice_address_join`.FIRSTNAME')->addAsColumn('invoice_address_LASTNAME', '`invoice_address_join`.LASTNAME')->addAsColumn('invoice_address_ADDRESS1', '`invoice_address_join`.ADDRESS1')->addAsColumn('invoice_address_ADDRESS2', '`invoice_address_join`.ADDRESS2')->addAsColumn('invoice_address_ADDRESS3', '`invoice_address_join`.ADDRESS3')->addAsColumn('invoice_address_ZIPCODE', '`invoice_address_join`.ZIPCODE')->addAsColumn('invoice_address_CITY', '`invoice_address_join`.CITY')->addAsColumn('invoice_address_PHONE', '`invoice_address_join`.PHONE')->endUse()->useOrderStatusQuery()->useOrderStatusI18nQuery()->addAsColumn('order_status_TITLE', OrderStatusI18nTableMap::TITLE)->endUse()->endUse()->select([OrderTableMap::REF, 'customer_REF', 'product_TITLE', 'product_PRICE', 'product_TAX', 'tax_TITLE', 'product_QUANTITY', 'product_WAS_IN_PROMO', OrderTableMap::DISCOUNT, 'coupon_COUPONS', OrderTableMap::POSTAGE, 'payment_module_TITLE', OrderTableMap::INVOICE_REF, OrderTableMap::DELIVERY_REF, 'delivery_module_TITLE', 'delivery_address_TITLE', 'delivery_address_COMPANY', 'delivery_address_FIRSTNAME', 'delivery_address_LASTNAME', 'delivery_address_ADDRESS1', 'delivery_address_ADDRESS2', 'delivery_address_ADDRESS3', 'delivery_address_ZIPCODE', 'delivery_address_CITY', 'delivery_address_country_TITLE', 'delivery_address_PHONE', 'invoice_address_TITLE', 'invoice_address_COMPANY', 'invoice_address_FIRSTNAME', 'invoice_address_LASTNAME', 'invoice_address_ADDRESS1', 'invoice_address_ADDRESS2', 'invoice_address_ADDRESS3', 'invoice_address_ZIPCODE', 'invoice_address_CITY', 'invoice_address_country_TITLE', 'invoice_address_PHONE', 'order_status_TITLE', 'currency_CODE', OrderTableMap::CREATED_AT])->orderByCreatedAt(Criteria::DESC);
     I18n::addI18nCondition($query, CustomerTitleI18nTableMap::TABLE_NAME, '`delivery_address_customer_title_join`.ID', CustomerTitleI18nTableMap::ID, '`delivery_address_customer_title_i18n_join`.LOCALE', $locale);
     I18n::addI18nCondition($query, CustomerTitleI18nTableMap::TABLE_NAME, '`invoice_address_customer_title_join`.ID', CustomerTitleI18nTableMap::ID, '`invoice_address_customer_title_i18n_join`.LOCALE', $locale);
     I18n::addI18nCondition($query, CountryI18nTableMap::TABLE_NAME, '`delivery_address_country_join`.ID', CountryI18nTableMap::ID, '`delivery_address_country_i18n_join`.LOCALE', $locale);
     I18n::addI18nCondition($query, CountryI18nTableMap::TABLE_NAME, '`invoice_address_country_join`.ID', CountryI18nTableMap::ID, '`invoice_address_country_i18n_join`.LOCALE', $locale);
     I18n::addI18nCondition($query, OrderStatusI18nTableMap::TABLE_NAME, OrderStatusI18nTableMap::ID, OrderStatusTableMap::ID, OrderStatusI18nTableMap::LOCALE, $locale);
     $data = $query->filterById($order[OrderTableMap::ID])->findOne();
     $order = (new Order())->setId($order[OrderTableMap::ID]);
     $order->setNew(false);
     $tax = 0;
     $data['order_TOTAL_TTC'] = $order->getTotalAmount($tax, false, false);
     $data['order_TOTAL_WITH_DISCOUNT'] = $order->getTotalAmount($tax, false, true);
     $data['order_TOTAL_WITH_DISCOUNT_AND_POSTAGE'] = $order->getTotalAmount($tax, true, true);
     return $data;
 }
开发者ID:vigourouxjulien,项目名称:thelia,代码行数:26,代码来源:OrderExport.php

示例3: loadStatsAjaxAction

 public function loadStatsAjaxAction()
 {
     if (null !== ($response = $this->checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW))) {
         return $response;
     }
     $data = new \stdClass();
     $data->title = $this->getTranslator()->trans("Stats on %month/%year", array('%month' => $this->getRequest()->query->get('month', date('m')), '%year' => $this->getRequest()->query->get('year', date('Y'))));
     /* sales */
     $saleSeries = new \stdClass();
     $saleSeries->color = $this->getRequest()->query->get('sales_color', '#adadad');
     $saleSeries->data = OrderQuery::getMonthlySaleStats($this->getRequest()->query->get('month', date('m')), $this->getRequest()->query->get('year', date('Y')));
     /* new customers */
     $newCustomerSeries = new \stdClass();
     $newCustomerSeries->color = $this->getRequest()->query->get('customers_color', '#f39922');
     $newCustomerSeries->data = CustomerQuery::getMonthlyNewCustomersStats($this->getRequest()->query->get('month', date('m')), $this->getRequest()->query->get('year', date('Y')));
     /* orders */
     $orderSeries = new \stdClass();
     $orderSeries->color = $this->getRequest()->query->get('orders_color', '#5cb85c');
     $orderSeries->data = OrderQuery::getMonthlyOrdersStats($this->getRequest()->query->get('month', date('m')), $this->getRequest()->query->get('year', date('Y')));
     /* first order */
     $firstOrderSeries = new \stdClass();
     $firstOrderSeries->color = $this->getRequest()->query->get('first_orders_color', '#5bc0de');
     $firstOrderSeries->data = OrderQuery::getFirstOrdersStats($this->getRequest()->query->get('month', date('m')), $this->getRequest()->query->get('year', date('Y')));
     /* cancelled orders */
     $cancelledOrderSeries = new \stdClass();
     $cancelledOrderSeries->color = $this->getRequest()->query->get('cancelled_orders_color', '#d9534f');
     $cancelledOrderSeries->data = OrderQuery::getMonthlyOrdersStats($this->getRequest()->query->get('month', date('m')), $this->getRequest()->query->get('year', date('Y')), array(5));
     $data->series = array($saleSeries, $newCustomerSeries, $orderSeries, $firstOrderSeries, $cancelledOrderSeries);
     $json = json_encode($data);
     return $this->jsonResponse($json);
 }
开发者ID:badelas,项目名称:thelia,代码行数:31,代码来源:HomeController.php

示例4: buildArray

 public function buildArray()
 {
     $order = OrderQuery::create()->findOneByRef($this->getRef());
     if (null !== $order && $order->getDeliveryModuleId() === DpdClassic::getModuleId()) {
         return [$order->getRef() => $order->getDeliveryRef()];
     }
     return [];
 }
开发者ID:thelia-modules,项目名称:DpdClassic,代码行数:8,代码来源:DpdClassicUrlTracking.php

示例5: buildForm

 protected function buildForm()
 {
     $entries = OrderQuery::create()->filterByDeliveryModuleId(DpdClassic::getModuleId())->find();
     $this->formBuilder->add('new_status_id', 'choice', array('label' => Translator::getInstance()->trans('Change order status to', [], DpdClassic::DOMAIN_NAME), 'choices' => array("nochange" => Translator::getInstance()->trans("Do not change", [], DpdClassic::DOMAIN_NAME), "processing" => Translator::getInstance()->trans("Set orders status as processing", [], DpdClassic::DOMAIN_NAME), "sent" => Translator::getInstance()->trans("Set orders status as sent", [], DpdClassic::DOMAIN_NAME)), 'required' => true, 'expanded' => true, 'multiple' => false, 'data' => 'nochange'));
     foreach ($entries as $order) {
         $orderRef = str_replace(".", "-", $order->getRef());
         $this->formBuilder->add($orderRef, 'checkbox', array('label' => $orderRef, 'label_attr' => array('for' => $orderRef)))->add($orderRef . "-assur", 'checkbox')->add($orderRef . "-pkgNumber", 'number')->add($orderRef . "-pkgWeight", 'number');
     }
 }
开发者ID:Mertiozys,项目名称:DpdClassic,代码行数:9,代码来源:ExportForm.php

示例6: buildForm

 protected function buildForm()
 {
     $status = OrderStatusQuery::create()->filterByCode(array(OrderStatus::CODE_PAID, OrderStatus::CODE_PROCESSING, OrderStatus::CODE_SENT), Criteria::IN)->find()->toArray("code");
     $query = OrderQuery::create()->filterByDeliveryModuleId(FreeShipping::getModuleId())->filterByStatusId(array($status['paid']['Id'], $status['processing']['Id']), Criteria::IN)->find();
     $this->formBuilder->add('new_status_id', 'choice', array('label' => Translator::getInstance()->trans('server'), 'choices' => array("nochange" => Translator::getInstance()->trans("Do not change"), "processing" => Translator::getInstance()->trans("Set orders status as processing"), "sent" => Translator::getInstance()->trans("Set orders status as sent")), 'required' => 'true', 'expanded' => true, 'multiple' => false, 'data' => 'nochange'));
     /** @var \Thelia\Model\Order $order */
     foreach ($query as $order) {
         $this->formBuilder->add("order_" . $order->getId(), "checkbox", array('label' => $order->getRef(), 'label_attr' => array('for' => 'export_' . $order->getId())));
     }
 }
开发者ID:Asenar,项目名称:thelia-FreeShipping,代码行数:10,代码来源:ExportOrder.php

示例7: buildArray

 public function buildArray()
 {
     $path = ExportExaprint::getJSONpath();
     if (is_readable($path) && ($order = OrderQuery::create()->findOneByRef($this->getRef())) !== null && $order->getDeliveryModuleId() === DpdPickup::getModuleId()) {
         $json = json_decode(file_get_contents($path), true);
         return array($this->getRef() => $json['expcode']);
     } else {
         return array();
     }
 }
开发者ID:lopes-vincent,项目名称:DpdPickup,代码行数:10,代码来源:DpdPickupUrlTracking.php

示例8: preImport

 public function preImport()
 {
     // Delete table before proceeding
     OrderQuery::create()->deleteAll();
     // Delete custom order status
     OrderStatusQuery::create()->filterById(5, Criteria::GREATER_THAN)->delete();
     // Create T1 <-> T2 IDs correspondance tables
     $this->order_corresp->reset();
     $this->importCustomOrderStatus();
 }
开发者ID:JumBay,项目名称:ImportT1,代码行数:10,代码来源:OrdersImport.php

示例9: receiveResponse

 /**
  * @throws \Exception
  */
 public function receiveResponse()
 {
     $request = $this->getRequest();
     $order_id = $request->get('reference');
     if (is_numeric($order_id)) {
         $order_id = (int) $order_id;
     }
     /*
      * Configure log output
      */
     $log = Tlog::getInstance();
     $log->setDestinations("\\Thelia\\Log\\Destination\\TlogDestinationFile");
     $log->setConfig("\\Thelia\\Log\\Destination\\TlogDestinationFile", 0, THELIA_ROOT . "log" . DS . "log-cmcic.txt");
     $log->info("accessed");
     $order = OrderQuery::create()->findPk($order_id);
     /*
      * Retrieve HMac for CGI2
      */
     $config = Config::read(CmCIC::JSON_CONFIG_PATH);
     $hashable = sprintf(CmCIC::CMCIC_CGI2_FIELDS, $config['CMCIC_TPE'], $request->get('date'), $request->get('montant'), $request->get('reference'), $request->get('texte-libre'), $config['CMCIC_VERSION'], $request->get('code-retour'), $request->get('cvx'), $request->get('vld'), $request->get('brand'), $request->get('status3ds'), $request->get('numauto'), $request->get('motifrefus'), $request->get('originecb'), $request->get('bincb'), $request->get('hpancb'), $request->get('ipclient'), $request->get('originetr'), $request->get('veres'), $request->get('pares'));
     $mac = CmCIC::computeHmac($hashable, CmCIC::getUsableKey($config["CMCIC_KEY"]));
     $response = CmCIC::CMCIC_CGI2_MACNOTOK . $hashable;
     if ($mac === strtolower($request->get('MAC'))) {
         $code = $request->get("code-retour");
         $msg = null;
         $status = OrderStatusQuery::create()->findOneByCode(OrderStatus::CODE_PAID);
         $event = new OrderEvent($order);
         $event->setStatus($status->getId());
         switch ($code) {
             case "payetest":
                 $msg = "The test payment of the order " . $order->getRef() . " has been successfully released. ";
                 $this->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event);
                 break;
             case "paiement":
                 $msg = "The payment of the order " . $order->getRef() . " has been successfully released. ";
                 $this->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event);
                 break;
             case "Annulation":
                 $msg = "Error during the paiement: " . $this->getRequest()->get("motifrefus");
                 break;
             default:
                 $log->error("Error while receiving response from CMCIC: code-retour not valid");
                 throw new \Exception(Translator::getInstance()->trans("An error occured, no valid code-retour"));
         }
         if (!empty($msg)) {
             $log->info($msg);
         }
         $response = CmCIC::CMCIC_CGI2_MACOK;
     }
     /*
      * Get log back to previous state
      */
     $log->setDestinations("\\Thelia\\Log\\Destination\\TlogDestinationRotatingFile");
     return Response::create(sprintf(CmCIC::CMCIC_CGI2_RECEIPT, $response), 200, array("Content-type" => "text/plain", "Pragma" => "nocache"));
 }
开发者ID:Mertiozys,项目名称:CmCIC,代码行数:58,代码来源:CmcicPayResponse.php

示例10: onInvoiceAfterDeliveryModule

 public function onInvoiceAfterDeliveryModule(HookRenderEvent $event)
 {
     // No So Colissimo information if the delivery module is not SoColissimo
     if (SoColissimo::getModuleId() == $event->getArgument('module_id')) {
         return;
     }
     $order = OrderQuery::create()->findOneById($event->getArgument('order'));
     if (!is_null($order)) {
         $event->add($this->render('delivery_mode_infos.html', ['delivery_address_id' => $order->getDeliveryOrderAddressId()]));
     }
 }
开发者ID:ThomasArnaud,项目名称:SoColissimo,代码行数:11,代码来源:PdfHook.php

示例11: loadStatsAjaxAction

 public function loadStatsAjaxAction()
 {
     if (null !== ($response = $this->checkAuth(self::RESOURCE_CODE, array(), AccessManager::VIEW))) {
         return $response;
     }
     $cacheExpire = ConfigQuery::getAdminCacheHomeStatsTTL();
     $cacheContent = false;
     $month = (int) $this->getRequest()->query->get('month', date('m'));
     $year = (int) $this->getRequest()->query->get('year', date('Y'));
     if ($cacheExpire) {
         $context = "_" . $month . "_" . $year;
         $cacheKey = self::STATS_CACHE_KEY . $context;
         $cacheDriver = new FilesystemCache($this->getCacheDir());
         if (!$this->getRequest()->query->get('flush', "0")) {
             $cacheContent = $cacheDriver->fetch($cacheKey);
         } else {
             $cacheDriver->delete($cacheKey);
         }
     }
     if ($cacheContent === false) {
         $data = new \stdClass();
         $data->title = $this->getTranslator()->trans("Stats on %month/%year", ['%month' => $month, '%year' => $year]);
         /* sales */
         $saleSeries = new \stdClass();
         $saleSeries->color = self::testHexColor('sales_color', '#adadad');
         $saleSeries->data = OrderQuery::getMonthlySaleStats($month, $year);
         /* new customers */
         $newCustomerSeries = new \stdClass();
         $newCustomerSeries->color = self::testHexColor('customers_color', '#f39922');
         $newCustomerSeries->data = CustomerQuery::getMonthlyNewCustomersStats($month, $year);
         /* orders */
         $orderSeries = new \stdClass();
         $orderSeries->color = self::testHexColor('orders_color', '#5cb85c');
         $orderSeries->data = OrderQuery::getMonthlyOrdersStats($month, $year);
         /* first order */
         $firstOrderSeries = new \stdClass();
         $firstOrderSeries->color = self::testHexColor('first_orders_color', '#5bc0de');
         $firstOrderSeries->data = OrderQuery::getFirstOrdersStats($month, $year);
         /* cancelled orders */
         $cancelledOrderSeries = new \stdClass();
         $cancelledOrderSeries->color = self::testHexColor('cancelled_orders_color', '#d9534f');
         $cancelledOrderSeries->data = OrderQuery::getMonthlyOrdersStats($month, $year, array(5));
         $data->series = array($saleSeries, $newCustomerSeries, $orderSeries, $firstOrderSeries, $cancelledOrderSeries);
         $cacheContent = json_encode($data);
         if ($cacheExpire) {
             $cacheDriver->save($cacheKey, $cacheContent, $cacheExpire);
         }
     }
     return $this->jsonResponse($cacheContent);
 }
开发者ID:margery,项目名称:thelia,代码行数:50,代码来源:HomeController.php

示例12: preImport

 public function preImport()
 {
     // Empty address, customer and customer title table
     OrderQuery::create()->deleteAll();
     AddressQuery::create()->deleteAll();
     OrderAddressQuery::create()->deleteAll();
     CustomerQuery::create()->deleteAll();
     // Also empty url rewriting table
     $con = Propel::getConnection(RewritingUrlTableMap::DATABASE_NAME);
     $con->exec('SET FOREIGN_KEY_CHECKS=0');
     RewritingUrlQuery::create()->deleteAll();
     $con->exec('SET FOREIGN_KEY_CHECKS=1');
     $this->cust_corresp->reset();
     if ($this->thelia_version > 150) {
         $this->importCustomerTitle();
     }
 }
开发者ID:JumBay,项目名称:ImportT1,代码行数:17,代码来源:CustomersImport.php

示例13: orderNumberPackage

 public function orderNumberPackage($params, $template = null)
 {
     $numberOfPackage = 1;
     $maxWeightPackage = TNTFrance::getConfigValue(TNTFranceConfigValue::MAX_WEIGHT_PACKAGE, 25);
     if (null != ($orderId = $this->getParam($params, "order_id", null))) {
         if (null != ($order = OrderQuery::create()->findPk($orderId))) {
             $orderTotalWeight = 0;
             foreach ($order->getOrderProducts() as $orderProduct) {
                 //Be sure that this orderProduct has no package already
                 if (null == ($tntResponse = TntOrderParcelResponseQuery::create()->findOneByOrderProductId($orderProduct->getId()))) {
                     $orderTotalWeight += $orderProduct->getQuantity() * $orderProduct->getWeight();
                 }
             }
             $numberOfPackage = ceil($orderTotalWeight / $maxWeightPackage);
         }
     }
     return $numberOfPackage;
 }
开发者ID:roadster31,项目名称:TNTFrance,代码行数:18,代码来源:TNTFormat.php

示例14: importDeliveryRef

 /**
  * Update order's delivery ref
  *
  * @param string    $deliveryRef
  * @param string    $orderRef
  * @param int       $i
  */
 public function importDeliveryRef($deliveryRef, $orderRef, &$i)
 {
     // Check if the order exists
     if (null !== ($order = OrderQuery::create()->findOneByRef($orderRef))) {
         $event = new OrderEvent($order);
         // Check if delivery refs are different
         if ($order->getDeliveryRef() != $deliveryRef) {
             $event->setDeliveryRef($deliveryRef);
             $this->getDispatcher()->dispatch(TheliaEvents::ORDER_UPDATE_DELIVERY_REF, $event);
             $sentStatusId = OrderStatusQuery::create()->filterByCode('sent')->select('ID')->findOne();
             // Set 'sent' order status if not already sent
             if ($sentStatusId != null && $order->getStatusId() != $sentStatusId) {
                 $event->setStatus($sentStatusId);
                 $this->getDispatcher()->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event);
             }
             $i++;
         }
     }
 }
开发者ID:ThomasArnaud,项目名称:SoColissimo,代码行数:26,代码来源:ImportController.php

示例15: importDeliveryRef

 /**
  * Update order's delivery ref
  *
  * @param string    $deliveryRef
  * @param string    $orderRef
  * @param int       $i
  */
 public function importDeliveryRef($deliveryRef, $orderRef, &$i)
 {
     // Get order
     $order = OrderQuery::create()->findOneByRef($orderRef);
     // Check if the order exists
     if ($order !== null) {
         $event = new OrderEvent($order);
         // Check if delivery refs are different
         if ($order->getDeliveryRef() != $deliveryRef) {
             $event->setDeliveryRef($deliveryRef);
             $this->getDispatcher()->dispatch(TheliaEvents::ORDER_UPDATE_DELIVERY_REF, $event);
             // Set 'sent' order status if not already sent
             if ($order->getStatusId() != DpdPickup::STATUS_SENT) {
                 $event->setStatus(DpdPickup::STATUS_SENT);
                 $this->getDispatcher()->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event);
             }
             $i++;
         }
     }
 }
开发者ID:lopes-vincent,项目名称:DpdPickup,代码行数:27,代码来源:ImportController.php


注:本文中的Thelia\Model\OrderQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。