获取支付规则二维码
@param string $product_id 商户定义的商品id 或者订单号
@return string
499496
public function createParamsForRuleQrc($product_id)
    {
        $pay = new Order($this->config->get());
        return $pay->qrcParams($product_id);
    }
748503
public function deleteImage($productId)
    {
        $productId = (int) $productId;

        if ($productId == 0 || $productId == '') {
            $message = 'Product ID not correct: ' . $productId;
            $this->log($message);
            die(json_encode([
                'status' => 0,
                'msg' => $message
            ]));
        }

        $product = $this->Product->find('all', [
            'conditions' => [
                'Products.id_product' => $productId
            ],
            'contain' => [
                'Images',
                'Manufacturers'
            ]
        ])->first();
        
        $this->Product->changeImage(
            [
                [$productId => 'no-image']
            ]
        );

        $actionLogMessage = __d('admin', 'Image_ID_{0}_from_manufacturer_{1}_was_deleted_successfully_Product_{1}_Manufacturer_{2}.', [
            $product->image->id_image,
            '<b>' . $product->name . '</b>',
            '<b>' . $product->manufacturer->name . '</b>'
        ]);

        $this->Flash->success($actionLogMessage);
        $this->ActionLog->customSave('product_image_deleted', $this->AppAuth->getUserId(), $productId, 'products', $actionLogMessage);

        $this->getRequest()->getSession()->write('highlightedRowId', $productId);

        $this->redirect($this->referer());
    }
1191942
public function getProductRatingById($productId)
    {
        $this->validateProductId($productId);

        $queryBuilder = $this->queryBuilderFactory->create();
        $queryBuilder
            ->select([
                'OXID',
                'OXRATING',
                'OXRATINGCNT'
            ])
            ->from('oxarticles')
            ->where('oxid = :productId')
            ->setMaxResults(1)
            ->setParameter('productId', $productId);

        return $this->mapper->map(
            new ProductRating(),
            $queryBuilder->execute()->fetch()
        );
    }
1264541
public function getProductName($productId): ?string
    {
        $product = $this->productRepository->find($productId);
        if (!$product instanceof ProductInterface) {
            return null;
        }

        return $product->getName();
    }
596228
static public function getProductsForCommerce($nb_commerce)
    {
        $nb_commerce_id = nb_getMixedValue($nb_commerce, NABU_COMMERCE_FIELD_ID);
        if (is_numeric($nb_commerce_id)) {
            $retval = CNabuCommerceProduct::buildObjectListFromSQL(
                'nb_commerce_product_id',
                'SELECT *
                   FROM nb_commerce_product
                  WHERE nb_commerce_id=%commerce_id$d',
                array(
                    'commerce_id' => $nb_commerce_id
                )
            );
            if ($nb_commerce instanceof CNabuCommerce) {
                $retval->setCommerce($nb_commerce);
            }
        } else {
            $retval = new CNabuCommerceProductCategoryList($nb_commerce instanceof CNabuCommerce ? $nb_commerce : null);
        }

        return $retval;
    }
1229796
public function getIndustryData(int $character_id)
    {

        $jobs = $this->getCharacterIndustry($character_id, false);

        return DataTables::of($jobs)
            ->editColumn('installerName', function ($row) {

                return view('web::partials.industryinstaller', compact('row'))
                    ->render();
            })
            ->editColumn('facilityName', function ($row) {

                return view('web::partials.industrysystem', compact('row'))
                    ->render();
            })
            ->editColumn('blueprintTypeName', function ($row) {

                return view('web::partials.industryblueprint', compact('row'))
                    ->render();
            })
            ->editColumn('productTypeName', function ($row) {

                return view('web::partials.industryproduct', compact('row'))
                    ->render();
            })
            ->rawColumns(['installerName', 'facilityName', 'blueprintTypeName', 'productTypeName'])
            ->make(true);

    }
829045
public function getProductValueModel($productId)
    {
        $dataType = ucfirst(strtolower($this->data_type));

        $method = 'productProperty' . $dataType . 'Value';

        $productPropertyModel = $this
                                        ->$method()
                                        ->whereProductId($productId)
                                        ->get();

        if ($productPropertyModel->count() == 0) {
            $valueClass = __NAMESPACE__ . '\\' . ucfirst($method);

            $valueModel = new $valueClass([
                'property_id' => $this->id,
                'product_id' => $productId
            ]);
        } else {
            $valueModel = $this->$method()->whereProductId($productId)->first();
        }

        return $valueModel;
    }
117069
public function update($product_id, array $data)
    {
        $result = null;
        $this->hook->attach('product.update.before', $product_id, $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $data['modified'] = GC_TIME;
        $data['product_id'] = $product_id;

        $this->setPrice($data);

        $updated = $this->db->update('product', $data, array('product_id' => $product_id));

        $updated += (int) $this->setSku($data);
        $updated += (int) $this->setTranslations($data, $this->translation_entity, 'product');
        $updated += (int) $this->setImages($data, $this->file, 'product');
        $updated += (int) $this->setAlias($data, $this->alias, 'product');
        $updated += (int) $this->setSkuCombinations($data);
        $updated += (int) $this->setOptions($data);
        $updated += (int) $this->setAttributes($data);
        $updated += (int) $this->setRelated($data);

        $result = $updated > 0;

        if ($result) {
            $this->search->index('product', $product_id);
        }

        $this->hook->attach('product.update.after', $product_id, $data, $result, $this);
        return (bool) $result;
    }
323787
protected function controlDeleteProductCompare(array &$result, $product_id)
    {
        if (empty($result['redirect'])) {
            $segments = explode(',', $this->path());
            if (isset($segments[0]) && $segments[0] === 'compare' && !empty($segments[1])) {
                $ids = array_filter(array_map('trim', explode(',', $segments[1])), 'ctype_digit');
                unset($ids[array_search($product_id, $ids)]);
                $result['redirect'] = $segments[0] . '/' . implode(',', $ids);
            }
        }
    }
1333296
public function deleteProduct($productId)
    {
        $result = $this->httpRaw(self::WECHAT_SHOP_PRODUCT_DELETE_URL . 'access_token=' . $this->getAccessToken(), [
            'product_id' => $productId
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
1149534
private function getBaseSelectGlobal($productIds, $storeId)
    {
        $select = $this->getConnection()->select()
            ->from(['cpi' => $this->getTable($this->getCategoryProductIndexTable($storeId))], [])
            ->joinLeft(
                ['p' => $this->getTable(ProductPositionResourceModel::TABLE_NAME)],
                'p.product_id = cpi.product_id AND p.category_id = cpi.category_id AND p.store_id = 0',
                []
            );

        $this->joinStorePosition($select, $storeId, 0);

        $select->where('cpi.store_id = ?', (int) $storeId)
            ->where('cpi.product_id IN(?)', $productIds)
            ->columns([
                'category_id'    => 'cpi.category_id',
                'product_id'     => 'cpi.product_id',
                'is_parent'      => 'cpi.is_parent',
                'is_virtual'     => new \Zend_Db_Expr('"false"'),
                'position'       => 'p.position',
                'is_blacklisted' => 'p.is_blacklisted',
            ]);

        return $select;
    }
1220928
public static function getItemIconUrl( int $item_id ): string
	{
		self::checkInit();
		return self::getSetting(self::SET_ENDPOINT) . self::getSetting(self::SET_VERSION) . "/img/item/{$item_id}.png";
	}
164794
public function getTransactionContent(int $character_id, int $client_id)
    {

        $transactions = $this->characterWalletTransactionInteraction($character_id, $client_id);

        return DataTables::of($transactions)
            ->editColumn('is_buy', function ($row) {

                return view('web::partials.transactionbuysell', compact('row'));
            })
            ->editColumn('unit_price', function ($row) {

                return number($row->unit_price);
            })
            ->addColumn('item_view', function ($row) {
                return view('web::partials.transactiontype', compact('row'));
            })
            ->addColumn('total', function ($row) {

                return number($row->unit_price * $row->quantity);
            })
            ->addColumn('client_view', function ($row) {

                $character_id = $row->character_id;

                $character = CharacterInfo::find($row->client_id) ?: $row->client_id;

                return view('web::partials.character', compact('character', 'character_id'));
            })
            ->rawColumns(['is_buy', 'client_view', 'item_view'])
            ->make(true);
    }
1254494
public function deleteProduct($product_id)
    {
        if (isset($this->_products[$product_id]["trial"]))
        {
            $this->deleteTrial($product_id);
        }
        if (isset($this->_products[$product_id]["subscription"]))
        {
            $this->deleteSubscription($product_id);
        }
        if (isset($this->_products[$product_id]["payment_plan"]))
        {
            $this->deletePaymentPlan($product_id);
        }
        unset($this->_products[$product_id]);

        return $this->_products;
    }
925070
public function listProductClassField($product_class_id)
    {
        $this->setProductClassProductClassField($product_class_id);
        $this->setTitleListProductClassField();
        $this->setBreadcrumbListProductClassField();
        $this->setFilterListProductClassField();

        $this->setData('field_types', $this->field->getTypes());
        $this->setData('fields', $this->getListProductClassField());
        $this->setData('product_class', $this->data_product_class);

        $this->submitListProductClassField();
        $this->outputListProductClassField();
    }
1350387
protected function setProductClassProductClassField($product_class_id)
    {
        $this->data_product_class = array();

        if (is_numeric($product_class_id)) {

            $this->data_product_class = $this->product_class->get($product_class_id);

            if (empty($this->data_product_class)) {
                $this->outputHttpStatus(404);
            }
        }
    }
1148094
public String getProdFeatureId(String productName) {
        String productId = null;
        if (!productName.equals(CORE_PRODUCT_NAME) && !productName.equals(USR_PRODUCT_EXT_NAME)) {
            readProductExtFeatureLocations();
            if (productExtNameInfoMap.containsKey(productName)) {
                productId = productExtNameInfoMap.get(productName).getProductID();
            }
        }

        return productId;
    }