Authored by Rock Zhang

添加未登录用户点击咨询赞或者有用时的跳转登陆页数据

... ... @@ -586,9 +586,10 @@ class DetailModel
*
* @param int $uid 用户ID
* @param int $id 咨询ID
* @param int $productId 商品ID
* @return array
*/
public static function upvoteConsult($uid, $id)
public static function upvoteConsult($uid, $id, $productId)
{
$result = array('code' => 400, 'message' => '出错啦~');
... ... @@ -598,6 +599,7 @@ class DetailModel
if (empty($uid)) {
$result['code'] = 401;
$result['message'] = '用户id为空';
$result['data'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/detail/consultform', array('product_id' => $productId))));
break;
}
... ... @@ -616,9 +618,10 @@ class DetailModel
*
* @param int $uid 用户ID
* @param int $id 咨询ID
* @param int $productId 商品ID
* @return array
*/
public static function usefulConsult($uid, $id)
public static function usefulConsult($uid, $id, $productId)
{
$result = array('code' => 400, 'message' => '出错啦~');
... ... @@ -628,6 +631,7 @@ class DetailModel
if (empty($uid)) {
$result['code'] = 401;
$result['message'] = '用户id为空';
$result['data'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/detail/consultform', array('product_id' => $productId))));
break;
}
... ...
... ... @@ -171,9 +171,10 @@ class DetailController extends AbstractAction
$result = array();
if ($this->isAjax()) {
$productId = $this->get('product_id', 0);
$uid = $this->getUid();
$id = $this->get('id');
$result = \Product\DetailModel::upvoteConsult($uid, $id);
$id = $this->post('id');
$result = \Product\DetailModel::upvoteConsult($uid, $id, $productId);
}
$this->echoJson($result);
... ... @@ -187,9 +188,10 @@ class DetailController extends AbstractAction
$result = array();
if ($this->isAjax()) {
$productId = $this->get('product_id', 0);
$uid = $this->getUid();
$id = $this->get('id');
$result = \Product\DetailModel::upvoteConsult($uid, $id);
$id = $this->post('id');
$result = \Product\DetailModel::upvoteConsult($uid, $id, $productId);
}
$this->echoJson($result);
... ...