<?php
/** 
 * UQ云商：	www.uqcms.com  
 * 联系QQ：	2200631718 
 * 可免费商用，需要留UQ云商链接作为交换，只首页底部留取即可，不影响使用。
 */

defined('IN_UQ') or exit('Access Denied'); class help_mod extends module { public function get_list($uq0) { $uq1 = $uq0['alias']??false; $uq2 = $this->db->get_one("select * from ".table('help_cats')." where alias = '".$uq1."' limit 1"); if($uq2['cid']){ $uq3 = $this->db->get_all("select * from ".table('help')." where cid = ".$uq2['cid']." order by addtime desc ".$this->limit($uq0['page'], $uq0['page_size'])); if($uq3){ foreach($uq3 as $uq4){ $uq5[] = $uq4; } $uq6['list'] = $uq5; return $uq6; } } return false; } public function get_one($uq0) { $uq7 = isset($uq0['id'])?$uq0['id']:''; $uq1 = isset($uq0['alias'])?$uq0['alias']:''; if($uq7){ $uq8 = " where id = ".$uq7; }elseif($uq1){ $uq8 = " where alias = '".$uq1."'"; }else{ return false; } $uq2 = $this->db->get_one("select * from ".table('help').$uq8); if($uq2 && $uq2['id']){ return $uq2; }else{ return false; } } public function footer($uq0) { $uq7 = isset($uq0['id'])?$uq0['id']:''; $uq9 = $this->db->get_all("select * from ".table('help_cats')." where alias = 'foot' and status = 1"); if($uq9){ foreach($uq9 as $uq4){ $uq10[] = $uq4['cid']; } $uq11 = implode(',', $uq10); $uq12 = $this->db->get_all("select id,cid,title from ".table('help')." where status = 1 and cid in(".$uq11.")"); if($uq12){ foreach($uq12 as $uq13){ $uq14[$uq13['cid']][] = $uq13; $uq15[$uq13['cid']][] = $uq13['id']; } } foreach($uq9 as $uq4){ $uq4['list'] = $uq14[$uq4['cid']]; if(in_array($uq7, $uq15[$uq4['cid']])){ $uq4['ck'] = '1'; }else{ $uq4['ck'] = '0'; } $uq16[] = $uq4; } return $uq16; }else{ return false; } } } 