Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * FecShop file. * * @link http://www.fecshop.com/ * @copyright Copyright (c)..
Decoded Output download
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshoppppphtml5\modules\Cataloglock\product;
//use fecshoppppphtml5\modules\Catalog\helpers\Review as ReviewHelper;
use Yii;
/**
* @author Terry Zhao <[email protected]>
* @since 1.0
*/
class Review extends \yiiase\BaseObject
{
public $product_id;
public $spu;
public $filterBySpu = true;
public $filterOrderBy = 'review_date';
public $reviw_rate_star_info;
public $review_count;
public $reviw_rate_star_average;
/**
* rewriteMapuse Yii::mapGet()classNameObject
*/
protected $_reviewHelperName = 'ecshoppppphtml5\modules\Catalog\helpers\Review';
protected $_reviewHelper;
public function init()
{
parent::init();
/**
* Yii::mapGet() classYii::mapGet@fecshop\yii\Yii.php
*/
list($this->_reviewHelperName,$this->_reviewHelper) = Yii::mapGet($this->_reviewHelperName);
// apphtml5service
$reviewHelper = $this->_reviewHelper;
$reviewHelper::initReviewConfig();
}
/**
* spu
*/
public function getLastData()
{
if (!$this->spu || !$this->product_id) {
return;
}
if ($this->filterBySpu) {
$data = $this->getReviewsBySpu($this->spu);
$count = $data['count'];
$coll = $data['coll'];
return [
'_id' => $this->product_id,
'spu' => $this->spu,
'coll' => $coll,
'noActiveStatus'=> Yii::$service->product->review->noActiveStatus(),
'reviw_rate_star_info' => $this->reviw_rate_star_info,
'review_count' => $this->review_count,
'reviw_rate_star_average' => $this->reviw_rate_star_average,
];
}
}
/**
* spu
*/
public function getReviewsBySpu($spu)
{
// $review = Yii::$app->getModule('catalog')->params['review'];
$appName = Yii::$service->helper->getAppName();
$productPageReviewCount = Yii::$app->store->get($appName.'_catalog','review_productPageReviewCount');
$productPageReviewCount = $productPageReviewCount ? $productPageReviewCount: 10;
$currentIp = ec\helpers\CFunc::get_real_ip();
$filter = [
'numPerPage' => $productPageReviewCount,
'pageNum' => 1,
'orderBy' => [$this->filterOrderBy => SORT_DESC],
'where' => [
[
'$or' => [
[
'status' => Yii::$service->product->review->activeStatus(),
'product_spu' => $spu,
],
[
'status' => Yii::$service->product->review->noActiveStatus(),
'product_spu' => $spu,
'ip' => $currentIp,
],
],
],
],
];
// review
return Yii::$service->product->review->getListBySpu($filter);
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace fecshop\app\apphtml5\modules\Catalog\block\product;
//use fecshop\app\apphtml5\modules\Catalog\helpers\Review as ReviewHelper;
use Yii;
/**
* @author Terry Zhao <[email protected]>
* @since 1.0
*/
class Review extends \yii\base\BaseObject
{
public $product_id;
public $spu;
public $filterBySpu = true;
public $filterOrderBy = 'review_date';
public $reviw_rate_star_info;
public $review_count;
public $reviw_rate_star_average;
/**
* rewriteMapuse Yii::mapGet()classNameObject
*/
protected $_reviewHelperName = '\fecshop\app\apphtml5\modules\Catalog\helpers\Review';
protected $_reviewHelper;
public function init()
{
parent::init();
/**
* Yii::mapGet() classYii::mapGet@fecshop\yii\Yii.php
*/
list($this->_reviewHelperName,$this->_reviewHelper) = Yii::mapGet($this->_reviewHelperName);
// apphtml5service
$reviewHelper = $this->_reviewHelper;
$reviewHelper::initReviewConfig();
}
/**
* spu
*/
public function getLastData()
{
if (!$this->spu || !$this->product_id) {
return;
}
if ($this->filterBySpu) {
$data = $this->getReviewsBySpu($this->spu);
$count = $data['count'];
$coll = $data['coll'];
return [
'_id' => $this->product_id,
'spu' => $this->spu,
'coll' => $coll,
'noActiveStatus'=> Yii::$service->product->review->noActiveStatus(),
'reviw_rate_star_info' => $this->reviw_rate_star_info,
'review_count' => $this->review_count,
'reviw_rate_star_average' => $this->reviw_rate_star_average,
];
}
}
/**
* spu
*/
public function getReviewsBySpu($spu)
{
// $review = Yii::$app->getModule('catalog')->params['review'];
$appName = Yii::$service->helper->getAppName();
$productPageReviewCount = Yii::$app->store->get($appName.'_catalog','review_productPageReviewCount');
$productPageReviewCount = $productPageReviewCount ? $productPageReviewCount: 10;
$currentIp = \fec\helpers\CFunc::get_real_ip();
$filter = [
'numPerPage' => $productPageReviewCount,
'pageNum' => 1,
'orderBy' => [$this->filterOrderBy => SORT_DESC],
'where' => [
[
'$or' => [
[
'status' => Yii::$service->product->review->activeStatus(),
'product_spu' => $spu,
],
[
'status' => Yii::$service->product->review->noActiveStatus(),
'product_spu' => $spu,
'ip' => $currentIp,
],
],
],
],
];
// review
return Yii::$service->product->review->getListBySpu($filter);
}
}
Function Calls
None |
Stats
MD5 | c38c36c09e5954354727e50078f30817 |
Eval Count | 0 |
Decode Time | 81 ms |