Browse Source

:bug: 单句数据库检索 有时返回空白字符串

visuddhinanda 5 years ago
parent
commit
18904630d1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/term/note.php

+ 1 - 1
app/term/note.php

@@ -56,7 +56,7 @@ $tran="";
 $db_file=_FILE_DB_SENTENCE_;
 try{
 	PDO_Connect("sqlite:$db_file");
-	$query="select * from sentence where book='{$bookId}' and paragraph='{$para}' and begin='{$begin}' and end='{$end}' order by modify_time DESC ";
+	$query="SELECT * FROM sentence WHERE book='{$bookId}' AND paragraph='{$para}' AND begin='{$begin}' AND end='{$end}'  AND text <> '' order by modify_time DESC limit 0 ,1 ";
 	$Fetch = PDO_FetchAll($query);
 	$iFetch=count($Fetch);
 	if($iFetch>0){