DAO 修正
This commit is contained in:
@@ -51,6 +51,15 @@ Thread
|
||||
}
|
||||
|
||||
|
||||
public static function
|
||||
find (
|
||||
int $id)
|
||||
: \Dto\Thread
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
public static function
|
||||
create_thread (
|
||||
SQLite3 $db,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/daos/response.php';
|
||||
require_once __DIR__ . '/daos/thread.php';
|
||||
require_once __DIR__ . '/dtos/response.php';
|
||||
require_once __DIR__ . '/dtos/thread.php';
|
||||
|
||||
+5
-4
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use \Dao;
|
||||
require_once __DIR__ . '/../import.php';
|
||||
|
||||
use \Dto;
|
||||
|
||||
|
||||
@@ -28,7 +29,7 @@ else
|
||||
$dir = './images/';
|
||||
$handle = opendir ($dir);
|
||||
|
||||
if ($row = Dao\Thread :: find ($thread))
|
||||
if ($row = \Dao\Thread :: find ($thread))
|
||||
{
|
||||
$title = $row -> title;
|
||||
$explain = $row -> explain;
|
||||
@@ -38,13 +39,13 @@ if (isset ($_GET['id']))
|
||||
{
|
||||
if (($_GET['evaluate'] ?? '') === 'good')
|
||||
{
|
||||
Dao\Response :: like ((int) $_GET['id']);
|
||||
\Dao\Response :: like ((int) $_GET['id']);
|
||||
header ("Location: ./?thread=$thread&sort=$sort");
|
||||
}
|
||||
|
||||
if (($_GET['evaluate'] ?? '') === 'bad')
|
||||
{
|
||||
Dao\Response :: dislike ((int) $_GET['id']);
|
||||
\Dao\Response :: dislike ((int) $_GET['id']);
|
||||
header ("Location: ./?thread=$thread&sort=$sort");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user