|
@@ -24,7 +24,12 @@ class DetailTransformer extends TransformerAbstract
|
|
|
|
|
|
public function transform(InterestCircle $interestCircle)
|
|
|
{
|
|
|
- $answer = $interestCircle['limit_condition'] - intval(Redis::get('circle_error_count_' . $this->uid));
|
|
|
+ if ($interestCircle['limit_condition']) {
|
|
|
+ $answer = $interestCircle['limit_condition'] - intval(Redis::get('circle_error_count_' . $this->uid));
|
|
|
+ } else {
|
|
|
+ $answer = -1;
|
|
|
+ }
|
|
|
+
|
|
|
$row = [
|
|
|
'id' => $interestCircle['id'],
|
|
|
'name' => $interestCircle['name'],
|
|
@@ -32,7 +37,7 @@ class DetailTransformer extends TransformerAbstract
|
|
|
'image' => $interestCircle['image'],
|
|
|
'join_limit' => $interestCircle['join_limit'],
|
|
|
'is_join' => $this->isJoin($this->uid, $interestCircle['id']),
|
|
|
- 'answer_count' => $answer > 0 ? $answer : 0,
|
|
|
+ 'answer_count' => $answer,
|
|
|
'is_black' => $this->isBlack($this->uid, $interestCircle['id'])
|
|
|
];
|
|
|
$funs = $this->getFunction($interestCircle);
|