リビジョン | 5b919aafbc592ed78b10e58120f19cdfb5c53318 (tree) |
---|---|
日時 | 2017-11-20 19:30:11 |
作者 | hylom <hylom@user...> |
コミッター | hylom |
@@ -147,6 +147,17 @@ sub _select_user { | ||
147 | 147 | my ($self, $uid, $params) = @_; |
148 | 148 | my ($limit_clause, $limit_values) = $self->build_limit_clause(params => $params); |
149 | 149 | |
150 | + # show future story? | |
151 | + my $extra_where_clause = ""; | |
152 | + if (!$params->{show_future}) { | |
153 | + $extra_where_clause = $extra_where_clause . " AND firehose.createtime <= NOW() "; | |
154 | + } | |
155 | + | |
156 | + # show non-public story? | |
157 | + if (!$params->{show_nonpublic} && !$params->{public}) { | |
158 | + $extra_where_clause = $extra_where_clause . " AND firehose.public != 'no' "; | |
159 | + } | |
160 | + | |
150 | 161 | my $sql = <<"EOSQL"; |
151 | 162 | SELECT firehose.*, |
152 | 163 | firehose_text.*, |
@@ -157,6 +168,7 @@ SELECT firehose.*, | ||
157 | 168 | JOIN users ON firehose.uid = users.uid |
158 | 169 | JOIN topics ON firehose.tid = topics.tid |
159 | 170 | WHERE firehose.uid = ? |
171 | + $extra_where_clause | |
160 | 172 | ORDER BY createtime DESC $limit_clause |
161 | 173 | EOSQL |
162 | 174 | my @params; |