|
@@ -178,9 +178,12 @@ class Index extends Api |
|
@@ -178,9 +178,12 @@ class Index extends Api |
178
|
$detail->getRelation('idea_type')->visible(['name']);
|
178
|
$detail->getRelation('idea_type')->visible(['name']);
|
179
|
$detail->visible(['title','id','all_number','collection','duration','mid_feel','idea_type']);
|
179
|
$detail->visible(['title','id','all_number','collection','duration','mid_feel','idea_type']);
|
180
|
$detail = $detail->toArray();
|
180
|
$detail = $detail->toArray();
|
181
|
- $db = Db::name('user_idea_record')->where('user_id',$this->auth->id)->where('idea_id',$id)->find();
|
|
|
182
|
- $detail['collection_status'] = isset($db['type']) && $db['type'] == 2 ? 1:0;
|
|
|
183
|
- $detail['experience_status'] = isset($db['type']) && $db['type'] == 1 ? 1:0;
|
181
|
+ $db = Db::name('user_idea_record')->where('user_id',$this->auth->id)->where('idea_id',$id)->select();
|
|
|
182
|
+ foreach ($db as $key => $value){
|
|
|
183
|
+ $detail['collection_status'] = isset($value['type']) && $value['type'] == 2 ? 1:0;
|
|
|
184
|
+ $detail['experience_status'] = isset($value['type']) && $value['type'] == 1 ? 1:0;
|
|
|
185
|
+ }
|
|
|
186
|
+
|
184
|
$this->success('点子详情',['detail'=>$detail]);
|
187
|
$this->success('点子详情',['detail'=>$detail]);
|
185
|
}
|
188
|
}
|
186
|
|
189
|
|