Skip to content

Commit

Permalink
🐛 修复关于小工具文章链接获取失败 #46 #74
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Jun 26, 2021
1 parent f9d05db commit 807ecb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inc/fun/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function widget( $args, $instance ){
global $wpdb;
$days = $this->get_num_val($instance, 'days');
$nums = $this->get_num_val($instance, 'nums');
$sql = "SELECT ID , post_title FROM $wpdb->posts WHERE post_type = 'post'
$sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post'
AND post_status = 'publish' AND TO_DAYS(now()) - TO_DAYS(post_date) < {$days}
ORDER BY ID DESC LIMIT 0 , {$nums} ";
$posts = $wpdb->get_results($sql);
Expand Down Expand Up @@ -286,7 +286,7 @@ function widget( $args, $instance ){
global $wpdb;
$days = $this->get_num_val($instance, 'days');
$nums = $this->get_num_val($instance, 'nums');
$sql = "SELECT ID , post_title, comment_count FROM $wpdb->posts WHERE post_type = 'post'
$sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post'
AND post_status = 'publish' AND TO_DAYS(now()) - TO_DAYS(post_date) < {$days}
ORDER BY comment_count DESC LIMIT 0 , {$nums} ";
$posts = $wpdb->get_results($sql);
Expand Down Expand Up @@ -524,7 +524,7 @@ function widget( $args, $instance ){
global $wpdb;
$days = $this->get_num_val($instance, 'days');
$nums = $this->get_num_val($instance, 'nums');
$sql = "SELECT ID , post_title FROM $wpdb->posts WHERE post_type = 'post'
$sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post'
AND post_status = 'publish' AND TO_DAYS(now()) - TO_DAYS(post_date) < {$days}
ORDER BY rand() DESC LIMIT 0 , {$nums} ";
$posts = $wpdb->get_results($sql);
Expand Down

0 comments on commit 807ecb6

Please sign in to comment.