|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use Plugin\Helpers;
|
|
|
|
|
|
/**
|
|
|
* 商品详情的控制器
|
...
|
...
|
@@ -31,6 +32,7 @@ class DetailController extends AbstractAction |
|
|
$this->error();
|
|
|
}
|
|
|
$data['goodsDetailPage'] = true;
|
|
|
$data['pageFooter'] = true;
|
|
|
|
|
|
if (isset($data['goodsName'])) {
|
|
|
$this->setTitle($data['goodsName']);
|
...
|
...
|
@@ -66,6 +68,7 @@ class DetailController extends AbstractAction |
|
|
*/
|
|
|
public function commentsAction()
|
|
|
{
|
|
|
$productId = $this->get('product_id', 0);
|
|
|
$total = $this->get('total');
|
|
|
if (!is_numeric($total)) {
|
|
|
$total = 0;
|
...
|
...
|
@@ -81,29 +84,7 @@ class DetailController extends AbstractAction |
|
|
'goodsCommentsPage' => true,
|
|
|
'pageFooter' => true,
|
|
|
'comments' => array(
|
|
|
'list' => array(
|
|
|
array(
|
|
|
'userName' => 'Lynnic',
|
|
|
'desc' => '购买了白色Mate7',
|
|
|
'content' => '活动时买的,挺超值。上身效果也不错。质量
|
|
|
很好,买送人的,很满意。而且物流相当给...',
|
|
|
'time' => '2014-08-12 10:24:26'
|
|
|
),
|
|
|
array(
|
|
|
'userName' => 'Lynnic',
|
|
|
'desc' => '购买了白色Mate7',
|
|
|
'content' => '活动时买的,挺超值。上身效果也不错。质量
|
|
|
很好,买送人的,很满意。而且物流相当给...',
|
|
|
'time' => '2014-08-12 10:24:26'
|
|
|
),
|
|
|
array(
|
|
|
'userName' => 'Lynnic',
|
|
|
'desc' => '购买了白色Mate7',
|
|
|
'content' => '活动时买的,挺超值。上身效果也不错。质量
|
|
|
很好,买送人的,很满意。而且物流相当给...',
|
|
|
'time' => '2014-08-12 10:24:26'
|
|
|
)
|
|
|
)
|
|
|
'list' => \Product\DetailModel::getConsults($productId),
|
|
|
),
|
|
|
);
|
|
|
|
...
|
...
|
@@ -136,7 +117,8 @@ class DetailController extends AbstractAction |
|
|
'pageFooter' => true,
|
|
|
'consults' => array(
|
|
|
'list' => \Product\DetailModel::getConsults($productId),
|
|
|
)
|
|
|
),
|
|
|
'consultUrl' => Helpers::url('/product/detail/consultform'),
|
|
|
);
|
|
|
|
|
|
// 渲染模板
|
...
|
...
|
@@ -148,19 +130,11 @@ class DetailController extends AbstractAction |
|
|
*/
|
|
|
public function consultformAction()
|
|
|
{
|
|
|
$data = array(
|
|
|
'consultform' => true,
|
|
|
'pageHeader' => array(
|
|
|
'navBack' => 'sss ',
|
|
|
// 'navHome' => 'sss ',
|
|
|
'navTitle' => '我要咨询'
|
|
|
)
|
|
|
);
|
|
|
$this->setTitle('我要咨询');
|
|
|
$this->setNavHeader('我要咨询');
|
|
|
|
|
|
$this->_view->assign('title', '我要咨询');
|
|
|
//$this->_view->display('brand', compact('brands'));
|
|
|
// 渲染模板
|
|
|
$this->_view->display('consultform', $data);
|
|
|
$this->_view->display('consultform', array('consultform' => true));
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -173,10 +147,10 @@ class DetailController extends AbstractAction |
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
//if ($this->isAjax()) {
|
|
|
$productSkn = $this->get('productSkn', 50000058);
|
|
|
$result = \Product\DetailModel::getPreference($productSkn); var_dump($result);
|
|
|
//}
|
|
|
if ($this->isAjax()) {
|
|
|
$productSkn = $this->get('productSkn'); // 50000058
|
|
|
$result = \Product\DetailModel::getPreference($productSkn);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
...
|
...
|
|