作者 李忠强
1 个管道 的构建 通过 耗费 1 秒

更新

@@ -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
@@ -432,7 +432,7 @@ class Mycenter extends Api @@ -432,7 +432,7 @@ class Mycenter extends Api
432 ->alias('u') 432 ->alias('u')
433 ->join('fa_idea i','u.idea_id=i.id') 433 ->join('fa_idea i','u.idea_id=i.id')
434 ->where('u.user_id',$userid) 434 ->where('u.user_id',$userid)
435 - ->where('type',1) 435 + ->where('u.type',1)
436 ->order('u.id','desc') 436 ->order('u.id','desc')
437 ->limit(5) 437 ->limit(5)
438 ->column('i.title'); 438 ->column('i.title');
@@ -446,6 +446,7 @@ class Mycenter extends Api @@ -446,6 +446,7 @@ class Mycenter extends Api
446 public function getUserPoster() 446 public function getUserPoster()
447 { 447 {
448 $list = $this->getUserIdeaList($this->auth->id); 448 $list = $this->getUserIdeaList($this->auth->id);
  449 + var_dump($list);exit();
449 if (count($list) < 1){ 450 if (count($list) < 1){
450 $this->error('当前用户未体验过点子'); 451 $this->error('当前用户未体验过点子');
451 } 452 }