<?php
/**
 * [UQcms System] Copyright uqcms.com
 * QQ: 2200631718
 * Author: gj.name
 * This is NOT a freeware
*/
defined('IN_UQ') or exit('Access Denied'); class goods_theme_mod extends module { function __construct(){ $this->uid = @$_SESSION['user']['uid']; parent::__construct(); } function street(){ $page = isset($arr['page'])?$arr['page']:1; $page_size = isset($arr['page_size'])?$arr['page_size']:20; $page_size2 = isset($arr['page_size2'])?$arr['page_size2']:5; $bquery = $this->db->get_all("select id,name,logo,status from ".table('shop')." where status = 1 order by id,px_recommend desc limit ".($page-1)*$page_size.",".$page_size); if($bquery){ foreach($bquery as $v){ $gquery = $this->db->get_all("select id,cid,brand,images,title,price,market_price from ".table('goods')." where shop_id = ".$v['id']." and status = 1 limit ".$page_size2); if($gquery){ foreach($gquery as $vv){ $gdata[] = $vv; } } if(isset($gdata)){ $v['glist'] = $gdata; } unset($gdata); $list[] = $v; } $data['list'] = $list; return $data; } } function brand($arr){ $page = isset($arr['page'])?$arr['page']:1; $page_size = isset($arr['page_size'])?$arr['page_size']:30; $page_type = isset($warr['page_type'])?$warr['page_type']:1; $limit = isset($arr['limit'])?$arr['limit']:false; if($limit){ $limit = $limit; }else{ $limit = ($page-1)*$page_size.",".$page_size; } $bquery = $this->db->get_all("select id,cid,name,`describe`,images,status from ".table('goods_brand')." where status = 1 order by id desc limit ".$limit); if($bquery){ foreach($bquery as $v){ $list[] = $v; } $data['list'] = $list; if($limit){ $total = $this->db->get_one("select count(*) as total from ".table('goods_brand')." where status = 1"); if($page_size < $total['total']){ $data['page'] = $this->uqcms_page(array('page'=>$page, 'page_size'=>$page_size, 'total'=>$total['total'], 'page_type'=>$page_type)); } } return $data; }else{ return false; } } function history_search(){ $page = isset($arr['page'])?$arr['page']:1; $page_size = isset($arr['page_size'])?$arr['page_size']:20; $page_type = isset($warr['page_type'])?$warr['page_type']:1; $limit = isset($arr['limit'])?$arr['limit']:false; if($limit){ $limit = $limit; }else{ $limit = ($page-1)*$page_size.",".$page_size; } $bquery = $this->db->get_all("select id,title,images,price,status,px_recommend from ".table('goods')." where status = 1 order by px_recommend desc limit ".($page-1)*$page_size.",".$page_size); if($bquery){ foreach($bquery as $v){ $list[] = $v; } $data['list'] = $list; if($limit){ $total = $this->db->get_one("select count(*) as total from ".table('goods')." where status = 1"); if($page_size < $total['total']){ $data['page'] = $this->uqcms_page(array('page'=>$page, 'page_size'=>$page_size, 'total'=>$total['total'], 'page_type'=>$page_type)); } } return $data; }else{ return false; } } }