params['category_id'])?$this->params['category_id']:'9999999']; $where[] = ['review_status','=',1]; return $where; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author whitef * @date 2024/07/07 18:23 */ public function lists(): array { $lists = GoodsReviews::where($this->searchWhere) ->where($this->queryWhere()) ->limit($this->limitOffset, $this->limitLength) ->field(['id','nickname','avatar','rating','comment','review_image','create_time']) ->order('create_time desc') ->select() ->toArray(); return $lists; } /** * @notes 获取数量 * @return int * @author whitef * @date 2024/07/07 18:23 */ public function count(): int { return GoodsReviews::where($this->searchWhere)->where($this->queryWhere())->count(); } }