This website works better with JavaScript.
Home
Explore
Register
Sign In
miteruzo
/
kekec_bbs
Watch
1
Star
0
Fork
0
Code
Issues
4
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
Dao\Thread :: find 追加
sqlite
みてるぞ
9 months ago
parent
dd3a9027d5
commit
2ade56a952
1 changed files
with
23 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+23
-2
daos/thread.php
+ 23
- 2
daos/thread.php
View File
@@ -22,7 +22,7 @@ Thread
LEFT OUTER JOIN
responses AS r
ON
r.thread
s
_id = t.id
r.thread_id = t.id
WHERE
t.id <> 1
-- AND t.deleted = 0
@@ -56,7 +56,28 @@ Thread
int $id)
: \Dto\Thread
{
;
// TODO: 書くこと
$sql = "
SELECT
t.id,
t.title,
t.explain,
MAX(r.date) AS latest
FROM
threads AS t
LEFT OUTER JOIN
responses AS r
ON
r.thread_id = t.id
WHERE
t.id = $id
GROUP BY
t.id
ORDER BY
latest DESC";
$result = $db -> query ($sql);
}
Write
Preview
Loading…
Cancel
Save