ENV_DB_HOST, 'username' => ENV_DB_USER, 'password' => ENV_DB_PASS, 'db'=> ENV_DB_DBNAME, 'port' => 3306, 'prefix' => 'wp_', 'charset' => 'utf8mb4')); // 文章列表 $sql_select = "select i.ID,i.post_title,i.post_content,i.guid,date_add(i.post_date, interval 8 hour) as post_time"; $sql_from = " from wp_posts as i inner join wp_term_relationships as ii on i.ID=ii.object_id inner join wp_terms as iii on ii.term_taxonomy_id=iii.term_id where iii.term_id=2 and i.post_status='publish' "; $total_result = $db->rawQueryOne("select count(i.ID) as total " . $sql_from); if(!empty($total_result) && $total_result['total'] > 0) { $pageCount = ceil($total_result['total'] / $pageCapacity); $sql_limit = "order by i.ID desc limit {$offset}, {$pageCapacity}"; $results = $db->rawQuery ($sql_select . $sql_from . $sql_limit); } } catch (\Throwable $th) { die("抱歉!系统维护中,暂停服务..."); } ?>