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

defined('IN_UQ') or exit('Access Denied'); class collect_mod extends module { function __construct() { $this->uid = @$_SESSION['user']['uid']; parent::__construct(); } function goods($uq0) { $uq1 = $this->db->get_all("select * from ".table('collect_goods')." where uid = ".$this->uid." order by addtime desc ".$this->limit($uq0['page'], $uq0['page_size'])); if($uq1){ foreach($uq1 as $uq2){ $uq3[] = $uq2['gid']; } if($uq3){ $uq4 = implode(',', $uq3); $uq5 = $this->db->get_all("select id,images,title,volume,price from ".table('goods')." where id in(".$uq4.")"); if($uq5){ foreach($uq5 as $uq2){ $uq6[$uq2['id']] = $uq2; } } } foreach($uq1 as $uq2){ if(isset($uq6[$uq2['gid']])){ $uq2['status'] = '1'; $uq2['title'] = $uq6[$uq2['gid']]['title']; $uq2['images'] = $uq6[$uq2['gid']]['images']; $uq2['price'] = $uq6[$uq2['gid']]['price']; }else{ $uq2['status'] = '0'; } $uq7[] = $uq2; } $uq8['list'] = $uq7; $uq9 = $this->db->get_one("select count(id) as total from ".table('collect_goods').' where uid = '.$this->uid); $uq0['total'] = $uq9['total']; $uq8['total'] = $uq9['total']?:'0'; $uq8['page'] = $this->page($uq0); return $uq8; }else{ return []; } } public function shop($uq0) { $uq10 = $this->db->get_all("select * from ".table('collect_shop')." where uid = ".$this->uid." ".$this->limit($uq11, $uq12)); if($uq10){ foreach($uq10 as $uq2){ $uq13[] = $uq2['spid']; } $uq14 = implode(',', $uq13); $uq15 = $this->db->get_all("select id,name,logo,status,collect from ".table("shop")." where id in(".$uq14.") and status = 1"); if($uq15){ foreach($uq15 as $uq2){ $uq16 = $this->db->get_all("select id,shop_id,title,images,price,volume,comment,status from ".table("goods")." where shop_id = ".$uq2['id']." and status = 1 limit 5"); $uq17['sp_row'] = $uq2; $uq17['gs_all'] = $uq16; $uq7[] = $uq17; } } $uq8['list'] = $uq7; return $uq8; } } } 