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

defined('IN_UQ') or exit('Access Denied'); class account_mod extends module { function __construct() { $this->uid = @$_SESSION['user']['uid']; parent::__construct(); } function pay_type(){ return [ '1'=>'购物支出', '2'=>'充值订单', '3'=>'维权退款', '4'=>'维权其他', '5'=>'分销支付', '0'=>'其他操作' ]; } public function get_order($uq0) { return $this->db->get_one("select id,pay_time,order_no,title,total_price from ".table('order_info')." where order_no = ".$uq0); } public function bill($uq1) { $uq2 = " where uid = ".$this->uid; $uq3 = $this->db->get_all("select * from ".table('member_bill').$uq2." order by id desc ".$this->limit($uq1['page'], $uq1['page_size'])); if($uq3){ foreach($uq3 as $uq4){ $uq4['addtime'] = _date($uq4['addtime']); $uq5[] = $uq4; } $uq6['list'] = $uq5; $uq7 = $this->db->get_one("select count(id) as total from ".table('member_bill').$uq2); $uq1['total'] = $uq7['total']; $uq6['page'] = $this->page($uq1); return $uq6; }else{ return false; } } function add($uq8, $uq9, $uq10, $uq11='0', $uq12 = null, $uq13=null) { $this->db->autocommit(); $uq1['uid'] = $uq8; $uq1['name'] = $uq10; $uq1['price'] = $uq9; $uq1['type'] = $uq11; $uq1['order_no'] = $uq12; $uq1['status'] = '1'; $uq1['remark'] = $uq13; $uq1['addtime'] = time(); $q1 = $this->db->add(table('member_bill'),$uq1); $q2 = $this->db->query("update ".table('member')." set price = price + ".$uq9." where uid = ".$uq8); if($q1 && $q2){ $this->db->rollback(); return true; }else{ $this->db->commit(); return false; } } function reduce($uq8, $uq9, $uq10, $uq11='0', $uq12 = null, $uq13=null) { $this->db->autocommit(); $uq1['uid'] = $uq8; $uq1['name'] = $uq10; $uq1['price'] = '-'.$uq9; $uq1['type'] = $uq11; $uq1['order_no'] = $uq12; $uq1['status'] = '1'; $uq1['remark'] = $uq13; $uq1['addtime'] = time(); $q1 = $this->db->add(table('member_bill'),$uq1); $q2 = $this->db->query("update ".table('member')." set price = price - ".$uq9." where uid = ".$uq8); if($q1 && $q2){ $this->db->rollback(); return true; }else{ $this->db->commit(); return false; } } function wallet(){ } function integral($uq1) { $uq2 = " where uid = ".$this->uid; $uq3 = $this->db->get_all("select * from ".table('member_integral').$uq2." order by id desc ".$this->limit($uq1['page'], $uq1['page_size'])); if($uq3){ foreach($uq3 as $uq4){ $uq4['addtime'] = _date($uq4['addtime']); $uq5[] = $uq4; } $uq6['list'] = $uq5; $uq7 = $this->db->get_one("select count(id) as total from ".table('member_integral').$uq2); $uq1['total'] = $uq7['total']; $uq6['page'] = $this->page($uq1); return $uq6; }else{ return false; } } function coupon($uq1) { $uq15 = isset($uq1['status'])?$uq1['status']:''; $uq2 = ''; $uq16 = time(); if($uq15 == '1'){ $uq2 .= ' and start_time <= '.$uq16.' and end_time >= '.$uq16.' and status = 1 '; }elseif($uq15 == '2'){ $uq2 .= ' and status = 0 '; }elseif($uq15 == '3'){ $uq2 .= ' and start_time >= '.$uq16.' and end_time <= '.$uq16.' and status = 0 '; }else{ $uq2 .= ' and start_time <= '.$uq16.' and end_time >= '.$uq16.' and status = 1 '; } $uq2 = ' where uid = '.$this->uid.' '.$uq2; $uq3 = $this->db->get_all("select * from ".table('member_coupon').$uq2." order by id desc ".$this->limit($uq1['page'], $uq1['page_size'])); if($uq3){ foreach($uq3 as $uq4){ $uq4['start_time'] = _date($uq4['start_time'], 'Y.m.d'); $uq4['end_time'] = _date($uq4['end_time'], 'Y.m.d'); $uq5[] = $uq4; } $uq6['list'] = @$uq5; $uq7 = $this->db->get_one("select count(id) as total from ".table('member_coupon').$uq2); $uq1['total'] = $uq7['total']; $uq6['page'] = $this->page($uq1); return $uq6; }else{ return false; } } public function withdraw_one($uq1) { $uq17 = $uq1['id']??false; if($uq17){ $uq18 = $this->db->get_one("select * from ".table('member_withdraw')." where uid = ".$this->uid." and id = ".$uq17); if($uq18['id']){ return $uq18; }else{ return false; } }else{ return false; } } public function withdraw_list($uq1) { $uq2 = ' where uid = '.$this->uid; $uq3 = $this->db->get_all("select * from ".table('member_withdraw').$uq2." order by id desc ".$this->limit($uq1['page'], $uq1['page_size'])); if($uq3){ foreach($uq3 as $uq4){ $uq4['addtime'] = _date($uq4['addtime']); $uq5[] = $uq4; } $uq6['list'] = $uq5; $uq7 = $this->db->get_one("select count(id) as total from ".table('member_withdraw').$uq2); $uq1['total'] = $uq7['total']; $uq6['page'] = $this->page($uq1); return $uq6; } } } 