作者 郭盛
1 个管道 的构建 通过 耗费 0 秒

修改评论

@@ -1095,18 +1095,17 @@ class Project extends Api @@ -1095,18 +1095,17 @@ class Project extends Api
1095 ->join('user b','a.user_id = b.id') 1095 ->join('user b','a.user_id = b.id')
1096 ->field('a.*,b.avatar,b.nickname,a.createtime') 1096 ->field('a.*,b.avatar,b.nickname,a.createtime')
1097 ->where($where) 1097 ->where($where)
1098 - ->select()  
1099 - ->toArray(); 1098 + ->select();
  1099 + foreach ($data as &$v){
  1100 + $v['is_zan'] = 1;
  1101 + $v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
  1102 + }
1100 $data['num'] = Db::name('comment') 1103 $data['num'] = Db::name('comment')
1101 ->alias('a') 1104 ->alias('a')
1102 ->join('user b','a.user_id = b.id') 1105 ->join('user b','a.user_id = b.id')
1103 ->field('a.*,b.avatar,b.nickname') 1106 ->field('a.*,b.avatar,b.nickname')
1104 ->where($where) 1107 ->where($where)
1105 ->count(); 1108 ->count();
1106 - foreach ($data as &$v){  
1107 - $v['is_zan'] = 1;  
1108 - $v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);  
1109 - }  
1110 $this->success('success',$data); 1109 $this->success('success',$data);
1111 } 1110 }
1112 $user_id = $this->getUserId(); 1111 $user_id = $this->getUserId();