迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計理念, 支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
打賞插件只有打賞人看得到自己支出的記錄,我們想同時給作者添加打賞收入記錄。
給打賞人的控制器里是這么寫
$this->db->where('uid', $this->uid )->order_by('inputtime DESC');
那么給作者的控制器怎么寫?
$this->db->where('uid', $content['uid'] )->order_by('inputtime DESC');
顯示不出來
控制器代碼發(fā)來看看
class Author_Home extends M_Controller { /** * */ public function __construct() { parent::__construct(); } // public function index() { $page = max((int)$this->input->get('page'), 1); $this->db->where('uid', $content['uid'] )->order_by('inputtime DESC'); if ($this->input->get('action') == 'more') { // ajax $data = $this->db->limit($this->pagesize, $this->pagesize * ($page - 1))->get("app_reward")->result_array(); if (!$data) { exit(null); } $this->template->assign('list', $data); $this->template->display('author_records_data.html'); } else { $this->template->assign(array( 'page' => max(2, $page + 1), 'list' => $this->db->limit($page ? $page * $this->pagesize : $this->pagesize)->get("app_reward")->result_array(), 'moreurl' => 'index.php?s=member&app=reward&c='.$this->router->class.'&m='.$this->router->method.'&action=more' )); $this->template->display('author_records.html'); } } }
$content['uid']
這個是從哪里來的,好像在亂寫,沒看出一點(diǎn)邏輯
回復(fù)@圖騰
應(yīng)該怎么寫才是作者(被打賞者)?
完全看不出你要做什么事情
回復(fù)@namingping
我是不懂呀,請教你。
想給作者添加打賞收入記錄,怎么在 作者-用戶中心-我的打賞收入 里顯示
這個控制器問題多,方法名都搞錯了,新入門的PHP程序員
回復(fù)@可愛的小兔子
我根本不會php哈哈,自己隨便改改看的。
。。。不會php就不要寫了,數(shù)據(jù)庫搞崩潰了就麻煩了,哈哈
控制器代碼發(fā)來看看
class Author_Home extends M_Controller { /** * */ public function __construct() { parent::__construct(); } // public function index() { $page = max((int)$this->input->get('page'), 1); $this->db->where('uid', $content['uid'] )->order_by('inputtime DESC'); if ($this->input->get('action') == 'more') { // ajax $data = $this->db->limit($this->pagesize, $this->pagesize * ($page - 1))->get("app_reward")->result_array(); if (!$data) { exit(null); } $this->template->assign('list', $data); $this->template->display('author_records_data.html'); } else { $this->template->assign(array( 'page' => max(2, $page + 1), 'list' => $this->db->limit($page ? $page * $this->pagesize : $this->pagesize)->get("app_reward")->result_array(), 'moreurl' => 'index.php?s=member&app=reward&c='.$this->router->class.'&m='.$this->router->method.'&action=more' )); $this->template->display('author_records.html'); } } }這個是從哪里來的,好像在亂寫,沒看出一點(diǎn)邏輯
回復(fù)@圖騰
應(yīng)該怎么寫才是作者(被打賞者)?
完全看不出你要做什么事情
回復(fù)@namingping
回復(fù)@圖騰
我是不懂呀,請教你。
想給作者添加打賞收入記錄,怎么在 作者-用戶中心-我的打賞收入 里顯示
這個控制器問題多,方法名都搞錯了,新入門的PHP程序員
回復(fù)@可愛的小兔子
我根本不會php哈哈,自己隨便改改看的。
。。。不會php就不要寫了,數(shù)據(jù)庫搞崩潰了就麻煩了,哈哈
回復(fù)@namingping