Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.189.143.114
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
wb /
src /
Command /
Delete
Unzip
Name
Size
Permission
Date
Action
UpdateAllCommand.php
43.82
KB
-rw-rw-r--
2023-08-22 14:58
UpdateReportsCommand.php
13.3
KB
-rw-rw-r--
2023-08-15 12:20
Save
Rename
<?php namespace App\Command; use App\Entity\Catalog; use App\Entity\CatalogLog; use App\Entity\CatalogUpdates; use App\Entity\Incomes; use App\Entity\Orders; use App\Entity\OrdersLog; use App\Entity\Sales; use App\Entity\SalesLog; use App\Entity\Stocks; use App\Entity\StocksLog; use App\Entity\Warehouses; use App\Entity\Reports; use App\Entity\User; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; class UpdateReportsCommand extends Command { protected static $defaultName = 'app:UpdateReports'; private $em; public function __construct(EntityManagerInterface $em) { $this->em = $em; parent::__construct(); } protected function configure() { $this ->setDescription('Add a short description for your command') ; } protected function execute(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); $date = new \DateTime(); $entityManager = $this->em; $catalogRepo = $this->getCatalogRepo(); $incomesRepo = $this->getIncomesRepo(); $ordersRepo = $this->getOrdersRepo(); $reportsRepo = $this->getReportsRepo(); $salesRepo = $this->getSalesRepo(); $stocksRepo = $this->getStocksRepo(); $stocksLogRepo = $this->getStocksLogRepo(); $catalogLogRepo = $this->getCatalogLogRepo(); $ordersLogRepo = $this->getOrdersLogRepo(); $catalogUpdatesRepo = $this->getCatalogUpdatesRepo(); $usersRepo = $this->getUserRepo(); $users = $usersRepo->findAll(); if (!empty($users)) { foreach ($users as $user) { if ($user->getStandartApiKey() and $user->getStatisticsApiKey()) { $standart_api_key = $user->getStandartApiKey(); $statistics_api_key = $user->getStatisticsApiKey(); $dataFrom = $update_time."T00:00:00"; $dataTo = $update_time."T23:59:59"; $url = 'https://statistics-api.wildberries.ru/api/v1/supplier/reportDetailByPeriod?dateFrom=2023-04-01T00:00:00&dateTo=2023-04-31T23:59:59'; $data = 'dateFrom=2023-04-01T00:00:00&dateTo=2023-04-31T23:59:59'; $headers = array( 'Authorization: ' . $statistics_api_key, //'Content-Type: application/json' ); $ch = curl_init(); $options = array( CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => $headers ); curl_setopt_array($ch, $options); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); $result = curl_exec($ch); $arResult = json_decode($result); $status = curl_getinfo($ch); curl_close($ch); if ($status["http_code"] == "200") { if (!empty($arResult)) { foreach ($arResult as $item) { $reports = new Reports(); if (!empty($item->realizationreport_id)) $reports->setRealizationreportId($item->realizationreport_id); if (!empty($item->date_from)) $reports->setDateFrom(new \DateTime($item->date_from)); if (!empty($item->date_to)) $reports->setDateTo(new \DateTime($item->date_to)); if (!empty($item->create_dt)) $reports->setCreateDt(new \DateTime($item->create_dt)); if (!empty($item->suppliercontract_code)) $reports->setSuppliercontractCode($item->suppliercontract_code); if (!empty($item->rrd_id)) $reports->setRrdId($item->rrd_id); if (!empty($item->gi_id)) $reports->setGiId($item->gi_id); if (!empty($item->subject_name)) $reports->setSubjectName($item->subject_name); if (!empty($item->nm_id)) $reports->setNmId($item->nm_id); if (!empty($item->brand_name)) $reports->setBrandName($item->brand_name); if (!empty($item->sa_name)) $reports->setSaName($item->sa_name); if (!empty($item->ts_name)) $reports->setTsName($item->ts_name); if (!empty($item->barcode)) $reports->setBarcode($item->barcode); if (!empty($item->doc_type_name)) $reports->setDocTypeName($item->doc_type_name); if (!empty($item->quantity)) $reports->setQuantity($item->quantity); if (!empty($item->retail_price)) $reports->setRetailPrice($item->retail_price); if (!empty($item->retail_amount)) $reports->setRetailAmount($item->retail_amount); if (!empty($item->sale_percent)) $reports->setSalePercent($item->sale_percent); if (!empty($item->commission_percent)) $reports->setCommissionPercent($item->commission_percent); if (!empty($item->office_name)) $reports->setOfficeName($item->office_name); if (!empty($item->supplier_oper_name)) $reports->setSupplierOperName($item->supplier_oper_name); if (!empty($item->order_dt)) $reports->setOrderDt(new \DateTime($item->order_dt)); if (!empty($item->sale_dt)) $reports->setSaleDt(new \DateTime($item->sale_dt)); if (!empty($item->rr_dt)) $reports->setRrDt(new \DateTime($item->rr_dt)); if (!empty($item->shk_id)) $reports->setShkId($item->shk_id); if (!empty($item->retail_price_withdisc_rub)) $reports->setRetailPriceWithdiscRub($item->retail_price_withdisc_rub); if (!empty($item->delivery_amount)) $reports->setDeliveryAmount($item->delivery_amount); if (!empty($item->return_amount)) $reports->setReturnAmount($item->return_amount); if (!empty($item->delivery_rub)) $reports->setDeliveryRub($item->delivery_rub); if (!empty($item->gi_box_type_name)) $reports->setGiBoxTypeName($item->gi_box_type_name); if (!empty($item->product_discount_for_report)) $reports->setProductDiscountForReport($item->product_discount_for_report); if (!empty($item->supplier_promo)) $reports->setSupplierPromo($item->supplier_promo); if (!empty($item->rid)) $reports->setRid($item->rid); if (!empty($item->ppvz_spp_prc)) $reports->setPpvzSppPrc($item->ppvz_spp_prc); if (!empty($item->ppvz_kvw_prc_base)) $reports->setPpvzKvwPrcBase($item->ppvz_kvw_prc_base); if (!empty($item->ppvz_kvw_prc)) $reports->setPpvzKvwPrc($item->ppvz_kvw_prc); if (!empty($item->ppvz_sales_commission)) $reports->setPpvzSalesCommission($item->ppvz_sales_commission); if (!empty($item->ppvz_for_pay)) $reports->setPpvzForPay($item->ppvz_for_pay); if (!empty($item->ppvz_reward)) $reports->setPpvzReward($item->ppvz_reward); if (!empty($item->acquiring_fee)) $reports->setAcquiringFee($item->acquiring_fee); if (!empty($item->acquiring_bank)) $reports->setAcquiringBank($item->acquiring_bank); if (!empty($item->ppvz_vw)) $reports->setPpvzVw($item->ppvz_vw); if (!empty($item->ppvz_vw_nds)) $reports->setPpvzVwNds($item->ppvz_vw_nds); if (!empty($item->ppvz_office_id)) $reports->setPpvzOfficeId($item->ppvz_office_id); if (!empty($item->ppvz_office_name)) $reports->setPpvzOfficeName($item->ppvz_office_name); if (!empty($item->ppvz_supplier_id)) $reports->setPpvzSupplierId($item->ppvz_supplier_id); if (!empty($item->ppvz_supplier_name)) $reports->setPpvzSupplierName($item->ppvz_supplier_name); if (!empty($item->ppvz_inn)) $reports->setPpvzInn($item->ppvz_inn); if (!empty($item->declaration_number)) $reports->setDeclarationNumber($item->declaration_number); if (!empty($item->bonus_type_name)) $reports->setBonusTypeName($item->bonus_type_name); if (!empty($item->sticker_id)) $reports->setStickerId($item->sticker_id); if (!empty($item->site_country)) $reports->setSiteCountry($item->site_country); if (!empty($item->penalty)) $reports->setPenalty($item->penalty); if (!empty($item->additional_payment)) $reports->setAdditionalPayment($item->additional_payment); if (!empty($item->kiz)) $reports->setKiz($item->kiz); if (!empty($item->srid)) $reports->setSrid($item->srid); if (!empty($item->sup_rating_prc_up)) $reports->setSupRatingPrcUp($item->sup_rating_prc_up); if (!empty($item->is_kgvp_v2)) $reports->setIsKgvpV2($item->is_kgvp_v2); if (!empty($item->rebill_logistic_cost)) $reports->setRebillLogisticCost($item->rebill_logistic_cost); if (!empty($item->rebill_logistic_org)) $reports->setRebillLogisticOrg($item->rebill_logistic_org); $reports->setAccountId($user->getId()); $reports->setCreatedAt($date); $reports->setUpdatedAt($date); $entityManager->persist($reports); } $entityManager->flush(); } } } } /*$dateCreate = new \DateTime((str_replace("T", "", $update_time))); $catalogUpdates = new CatalogUpdates(); $catalogUpdates->setCreatedAt($dateCreate); $catalogUpdates->setStatus(1); $entityManager->persist($catalogUpdates); $entityManager->flush();*/ //} } $io->success('Finished.'); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\CatalogRepository */ protected function getCatalogRepo() { return $this->em->getRepository(Catalog::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\CatalogRepository */ protected function getCatalogLogRepo() { return $this->em->getRepository(CatalogLog::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\CatalogRepository */ protected function getCatalogUpdatesRepo() { return $this->em->getRepository(CatalogUpdates::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\UserRepository */ protected function getUserRepo() { return $this->em->getRepository(User::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\IncomesRepository */ protected function getIncomesRepo() { return $this->em->getRepository(Incomes::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\OrdersRepository */ protected function getOrdersRepo() { return $this->em->getRepository(Orders::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\ReportsRepository */ protected function getReportsRepo() { return $this->em->getRepository(Reports::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\SalesRepository */ protected function getSalesRepo() { return $this->em->getRepository(Sales::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\StocksRepository */ protected function getStocksRepo() { return $this->em->getRepository(Stocks::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\StocksLogRepository */ protected function getStocksLogRepo() { return $this->em->getRepository(StocksLog::class); } /** * @return \Doctrine\ORM\EntityRepository|\App\Repository\OrdersLogRepository */ protected function getOrdersLogRepo() { return $this->em->getRepository(OrdersLog::class); } }