We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbb2b04 commit fd48802Copy full SHA for fd48802
func.php
@@ -150,8 +150,9 @@ function del(){
150
* render data to markdown text
151
*/
152
function render(){
153
- $data=get_db()->get_all();
154
- $current=$data[count($data)-1]['number'];
+ $mdb=get_db();
+ $data=$mdb->get_all();
155
+ $current=$mdb->current_number();
156
$content="码农周刊分类整理
157
======
158
码农周刊的类别分的比较大,不易于后期查阅,所以我把每期的内容按语言或技术进行了分类整理。
@@ -328,5 +329,10 @@ function add($data){
328
329
function get_all(){
330
return $this->pdo->query('select * from issue order by category,addtime')->fetchAll(PDO::FETCH_ASSOC);
331
}
332
+
333
+ function current_number(){
334
+ $rs=$this->pdo->query('select max(number) as max from issue')->fetch(PDO::FETCH_ASSOC);
335
+ return $rs['max'];
336
+ }
337
338
?>
0 commit comments