示例#1
0
 public function findByProductIdAll($type, $productId, $offsize, $limt)
 {
     $CommentAll = Comment::findBySql('select mc.content,mc.publishTime,mu.nickName,mc.score  from mp_comment mc LEFT JOIN mp_user mu ON mc.userId =mu.id    where mc.type = ' . $type . ' and mc.typeId in( select id from mp_order_detail where productId = ' . $productId . ' and isEvaluate = 1 ) order By publishTime DESC ')->asArray()->all();
     if ($limt != 0) {
         $CommentAll = Comment::findBySql('select mc.content,mc.publishTime,mu.nickName,mc.score  from mp_comment mc LEFT JOIN mp_user mu ON mc.userId =mu.id    where mc.type = ' . $type . ' and mc.typeId in( select id from mp_order_detail where productId = ' . $productId . ' and isEvaluate = 1 ) order By publishTime DESC  limit ' . $offsize . ',' . $limt . '  ')->asArray()->all();
     }
     if (!$CommentAll) {
         return false;
     }
     return $CommentAll;
 }