Пример #1
0
 public function actionAdmin()
 {
     $model = new ProductList('search');
     $model->unsetAttributes();
     if (isset($_GET['ProductList'])) {
         $model->setAttributes($_GET['ProductList']);
     }
     $this->render('admin', array('model' => $model));
 }
Пример #2
0
 public function testContaining()
 {
     $root = Category::getRootNode();
     $list = ProductList::getNewInstance($root);
     $list->save();
     $product = Product::getNewInstance($root);
     $product->save();
     $list->addProduct($product);
     $another = Product::getNewInstance($root);
     $another->save();
     $this->assertTrue($list->contains($product));
     $this->assertFalse($list->contains($another));
 }
Пример #3
0
<?php

$this->breadcrumbs = array(ProductList::label(2), Yii::t('app', 'Index'));
$this->menu = array(array('label' => Yii::t('app', 'Create') . ' ' . ProductList::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Manage') . ' ' . ProductList::label(2), 'url' => array('admin')));
?>

<h1><?php 
echo GxHtml::encode(ProductList::label(2));
?>
</h1>

<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
Пример #4
0
 /** 
  * 查询产品列表
  * @param $userId
  * @param $perPage
  * @param $currPage
  * 返回json数据
  */
 public function querryProductList()
 {
     $ip = new IPFilter(getonlineip());
     if ($ip->isAllowable() != 1) {
         return json_encode(lang('ip_denied'));
     }
     $productList = new ProductList();
     return json_encode($productList->getProducts());
 }
Пример #5
0
echo "<br>";
//测试用户账户充值  单位人民币分
$res = $account->addBalance("10", "2");
echo "addBalance=" . $res;
echo "<br>";
$res = $account->buy("100004", "1", "1");
echo "buy=" . $res;
echo "<br>";
$res = $account->getServiceTime("100003");
echo "getServiceTime=" . $res;
echo "<br>";
$res = $account->isInService("100003");
echo "isInService=" . $res;
echo "<br>";
//测试查询产品列表
echo "<br>productList->getProducts-----------------------<br>";
$productList = new ProductList();
$res = $productList->getProducts();
print_r($res);
echo "<br>";
echo "<br>rechargeHistory->getHistoryList-----------------------<br>";
//测试查询账户历史
$rechargeHistory = new RechargeHistory($account->accountId);
$res = $rechargeHistory->getHistoryList("10", "1");
print_r($res);
echo "<br>";
//测试查询测试查询交易历史
echo "<br>transactionHistory->getHistoryList-----------------------<br>";
$transactionHistory = new TransactionHistory($account->accountId);
$res = $transactionHistory->getHistoryList("10", "1");
print_r($res);
Пример #6
0
 /**
  * @param Product $product
  */
 public function setItem(Product $product)
 {
     $this->list->setItem($product);
 }
Пример #7
0
    {
        $brandName = Helper::clean_string($brandName);
        return $this->getCategoryLink('brand', $brandName, 1);
    }
    function categoryLink($catName)
    {
        $catName = Helper::clean_string($catName);
        return $this->getCategoryLink('category', $catName, 1);
    }
    function cleanDoubleQuote($str)
    {
        return str_replace('"', '', $str);
    }
}
$productItems = $module['productItems']['category-group'];
$obj = new ProductList();
$i = 0;
foreach ($productItems as $productFile => $items) {
    $key = key($items);
    $catName = $items[$key]['category'];
    ?>
	<div class="category-title">
		<h2 class="linetext">
			<span><a href="<?php 
    echo $obj->categoryLink($catName);
    ?>
"><?php 
    echo $catName;
    ?>
</a></span>
		</h2>