...
|
...
|
@@ -567,6 +567,11 @@ class DetailModel |
|
|
$build['question'] = $value['ask'];
|
|
|
$build['time'] = $value['askTime'];
|
|
|
$build['answer'] = $value['answer'];
|
|
|
$build['id'] = $value['id'];
|
|
|
$build['isLike'] = $value['isLike'];
|
|
|
$build['like'] = $value['like'];
|
|
|
$build['isUseful'] = $value['isUseful'];
|
|
|
$build['useful'] = $value['useful'];
|
|
|
$result[] = $build;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -577,6 +582,66 @@ class DetailModel |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 咨询点赞
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $id 咨询ID
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function upvoteConsult($uid, $id)
|
|
|
{
|
|
|
$result = array('code' => 400, 'message' => '出错啦~');
|
|
|
|
|
|
do {
|
|
|
$record = DetailData::upvoteConsult($uid, $id);
|
|
|
|
|
|
if (empty($uid)) {
|
|
|
$result['code'] = 401;
|
|
|
$result['message'] = '用户id为空';
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
// 处理数据
|
|
|
if ($record && isset($record['code'])) {
|
|
|
$result['code'] = $record['code'];
|
|
|
$result['message'] = $record['message'];
|
|
|
}
|
|
|
}while(false);
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 咨询有用
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $id 咨询ID
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function usefulConsult($uid, $id)
|
|
|
{
|
|
|
$result = array('code' => 400, 'message' => '出错啦~');
|
|
|
|
|
|
do {
|
|
|
$record = DetailData::upvoteConsult($uid, $id);
|
|
|
|
|
|
if (empty($uid)) {
|
|
|
$result['code'] = 401;
|
|
|
$result['message'] = '用户id为空';
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
// 处理数据
|
|
|
if ($record && isset($record['code'])) {
|
|
|
$result['code'] = $record['code'];
|
|
|
$result['message'] = $record['message'];
|
|
|
}
|
|
|
}while(false);
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取为你优选的商品
|
|
|
*
|
|
|
* @param int $productSkn 商品SKN
|
...
|
...
|
|