迅睿開源框架是一款PHP8高性能·簡(jiǎn)單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計(jì)理念, 支持的微信公眾號(hào)、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
文章頁的上一頁下一頁是按照id前后調(diào)用的,誰知道怎么改成按更新時(shí)間調(diào)用嗎
可以按照官方的寫法,復(fù)制到模板中去,再改進(jìn)就行了
回復(fù)@二開/定制/使用解答專家 官方的寫法哪里有
已解決,修改這段就行
// 上一篇文章
$this->db->where('catid', $data['catid'])->where('status', 9);
$this->db->where('id<', $data['id']);
$this->db->order_by('id desc');
$data['prev_page'] = $this->db->limit(1)->get($this->content_model->prefix)->row_array();
// 下一篇文章
$this->db->where('id>', $data['id']);
$this->db->order_by('id asc');
$data['next_page'] = $this->db->limit(1)->get($this->content_model->prefix)->row_array();
可以按照官方的寫法,復(fù)制到模板中去,再改進(jìn)就行了
回復(fù)@二開/定制/使用解答專家 官方的寫法哪里有
已解決,修改這段就行
// 上一篇文章
$this->db->where('catid', $data['catid'])->where('status', 9);
$this->db->where('id<', $data['id']);
$this->db->order_by('id desc');
$data['prev_page'] = $this->db->limit(1)->get($this->content_model->prefix)->row_array();
// 下一篇文章
$this->db->where('catid', $data['catid'])->where('status', 9);
$this->db->where('id>', $data['id']);
$this->db->order_by('id asc');
$data['next_page'] = $this->db->limit(1)->get($this->content_model->prefix)->row_array();