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


PHP Purchase::init方法代码示例

本文整理汇总了PHP中Purchase::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Purchase::init方法的具体用法?PHP Purchase::init怎么用?PHP Purchase::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Purchase的用法示例。


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

示例1: callcheckPlatform

 public function callcheckPlatform()
 {
     include_once ENGINE_PATH . 'class/classProducts.php';
     include_once ENGINE_PATH . 'class/classPurchase.php';
     $products = new Products();
     $platforms = $products->getProductsPlatforms($_POST['productId']);
     $purchase = new Purchase();
     $purchase->init($_POST['productId']);
     $os = $purchase->checkOS($_SERVER['HTTP_USER_AGENT']);
     $countplatform = count($platforms);
     for ($i = 0; $i < $countplatform; $i++) {
         if (stristr($platforms[$i]['os_value'], $os)) {
             return 1;
         }
     }
     return 0;
 }
开发者ID:rjon76,项目名称:netspotapp,代码行数:17,代码来源:classAjaxController.php

示例2: getProductInfo

 public function getProductInfo($args)
 {
     include_once ENGINE_PATH . 'class/classPurchase.php';
     $result = array();
     $product_id = $args[0];
     $build_info = $this->products->getProductBuildInfo($product_id);
     $platforms = $this->products->getProductsPlatforms($product_id);
     $platforms_tmp = array();
     foreach ($platforms as $os) {
         array_push($platforms_tmp, $os['os_value']);
     }
     $lang = $this->products->getProductLanguagesIds($product_id);
     $result['name'] = $build_info['p_title'];
     $result['nick'] = $build_info['p_nick'];
     $result['download'] = $build_info['p_download'];
     $result['softwareVersion'] = $build_info['p_version'];
     $result['datePublished'] = $build_info['ctime'];
     //		$result['author'] = array('name'=>'Eltima Software', 'url'=>'www.eltima.com');
     $result['fileSize'] = $build_info['size'];
     $result['operatingSystems'] = implode(',', $platforms_tmp);
     $result['inLanguage'] = implode(',', $lang);
     $purchase = new Purchase();
     if ($purchase->init($product_id)) {
         $licenseData = $purchase->processLicenseData();
         $result['licenses'] = $licenseData['lic'];
     }
     $result['Rating'] = mt_rand(450, 500) / 100;
     $result['TotalVotes'] = mt_rand(10, 100);
     return $result;
 }
开发者ID:rjon76,项目名称:netspotapp,代码行数:30,代码来源:index.php


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