alias( as a ) ->join( qxy_test as b o..."/>
您好,登錄后才能下訂單哦!
$view = D('HistoryTest') ->alias("as a") ->join("qxy_test as b on a.object = b.id") ->field("b.title,b.id,a.uid") ->order('a.id desc') ->where("a.title like '%".$key."%'") ->select(); $view = $this->multi_unique($view); ?。{(diào)用去重方法 $count = count($view); $Page = new \Think\Page($count,5); //每頁顯示條數(shù) $view = array_slice($view, $Page->firstRow,$Page->listRows); ?。纸M函數(shù) $show = $Page->show(); ?。@示分頁 $this->sear = $view; ?。l(fā)送變量 $this->page = $show; public function multi_unique($array) { ?。瘮?shù)組去重方法 foreach ($array as $k=>$na) $new[$k] = serialize($na); $uniq = array_unique($new); foreach($uniq as $k=>$ser) $data[$k] = unserialize($ser); return ($data); }
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。