no message

deploy
DESKTOP-4RNDQIC\29019 2020-06-17 13:17:15 +08:00
parent 3bd828c4f0
commit a1d8096a0e
3 changed files with 23 additions and 1 deletions

View File

@ -47,6 +47,7 @@ class Blog extends Controller
]);
}
}
function articleAction() {
if(sizeof($this->querys) != 0){
echo '<pre>';
@ -92,6 +93,7 @@ class Blog extends Controller
View::renderTemplate("/blog/basic.html",['title'=>'test','index'=>false]);
}
}
function donateAction(){
View::renderTemplate("/blog/basic.html",
[

View File

@ -33,6 +33,20 @@ class Doc extends \Core\Controller
$ret = $docs->Count();
$this->JsonResp(200,$ret,"OK");
}
// 查找文件名字
function articleSearchAction(){
if(isset($this->input->title)){
$docModel = new Models\Doc();
$titles = $docModel->titleLikeDoc($this->input->title);
$this->JsonResp(0,$titles,"OK");
}else{
$this->JsonResp(200,null,"error");
}
}
}

View File

@ -75,6 +75,12 @@ class Doc extends Model
$recv = $stmt->fetchAll();
return $recv;
}
public function titleLikeDoc($title){
$db = static::getDB();
$stmt = $db->query('select * from doc where title like \'%%'.$title.'\'%% and doc.is_public = 0');
$recv = $stmt->fetchAll();
return $recv;
}
public function Count(){
$db = static::getDB();
$stmt = $db->query('select count(*) from doc');