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

defined('IN_UQ') or exit('Access Denied'); class count_mod extends module { function __construct() { $this->uid = $_SESSION['user']['uid']; $this->spid = $_SESSION['shop']['id']; parent::__construct(); } function order($uq0 = array()) { $uq1 = $uq0['uid']??''; if(empty($uq1)){ $uq1 = $this->uid; } $row1 = $this->db->get_one("select count(id) as total from ".table('order_info')." where uid = ".$uq1." and order_status = 1"); $row2 = $this->db->get_one("select count(id) as total from ".table('order_info')." where uid = ".$uq1." and order_status = 2"); $row3 = $this->db->get_one("select count(id) as total from ".table('order_info')." where uid = ".$uq1." and order_status = 3"); $row4 = $this->db->get_one("select count(id) as total from ".table('order_info')." where uid = ".$uq1." and order_status = 4"); $uq3['1'] = $row1['total']; $uq3['2'] = $row2['total']; $uq3['3'] = $row3['total']; $uq3['4'] = $row4['total']; $uq4 = $this->db->get_one("select count(id) as total from ".table('refund')." where uid = ".$this->uid." and status = 1"); $uq3['refund'] = $uq4['total']; return $uq3; } function collect($uq0) { $uq1 = $uq0['uid']??''; if(empty($uq1)){ $uq1 = $this->uid; } $row1 = $this->db->get_one("select count(id) as total from ".table('collect_shop')." where uid = ".$uq1); $row2 = $this->db->get_one("select count(id) as total from ".table('collect_goods')." where uid = ".$uq1); $uq3['goods'] = $row1['total']; $uq3['shop'] = $row2['total']; return $uq3; } function view() { $uq5 = @$_COOKIE['goods_view']; return count($uq5); } function shop_index() { $uq6 = $this->db->get_one("select count(*) as total from ".table('refund')." where spid = ".$this->spid.' and status = 1'); $uq3['refund'] = $uq6['total']; $uq7 = strtotime(date('Y-m-d 00:00:00', time())); $uq8 = $this->db->get_one("select SUM(total_price) as sum from ".table('order_info')." where shop_id = ".$this->spid." and pay_time > ".$uq7); $uq3['order_price'] = isset($uq8['sum'])?$uq8['sum']:0.00; $uq6 = $this->db->get_one("select count(*) as total from ".table('order_info')." where shop_id = ".$this->spid.' and addtime > '.$uq7); $uq3['order_num'] = $uq6['total']; $uq6 = $this->db->get_one("select count(*) as total from ".table('order_info')." where shop_id = ".$this->spid.' and order_status = 2'); $uq3['order_send'] = $uq6['total']; return $uq3; } } 