no message
parent
3bd828c4f0
commit
a1d8096a0e
|
@ -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",
|
||||
[
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue