⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 useramount.class.php

📁 是一个基于PHP+Mysql架构的开源内容管理系统
💻 PHP
字号:
<?php
class useramount
{
	var $_amount_table = '';
	var $_db = '';
	var $pay ='';
	var $typeid = 0;

	function __construct($typeid = 0)
	{
		$this->useramount($typeid);
	}

	function useramount($typeid = 0)
	{
		global $db;
		$this->_db		= $db;
		$this->typeid	= $typeid;
		$this->pay		= load('pay_api.class.php', 'pay', 'api');
		$this->table_amount = DB_PRE.'pay_user_account';
	}

	/**
	 *
	 *	@params
	 *	@return
	 */

	function get_list($condition = null, $page = 1, $pagesize)
	{
		$list = array();
		$page = max(intval($page), 1);
        $offset = $pagesize*($page-1);
		$lists = $money = array();
		$arg['where'] = $this->_make_condition($condition);
		$lists['num'] = $this->_db->get_one("SELECT COUNT(*) AS number FROM `$this->table_amount` WHERE `type` = '{$this->typeid}' {$arg['where']} ");
		$lists['pages'] = pages($lists['num']['number'], $page, $pagesize);
		$sql = "SELECT * FROM `$this->table_amount` where `type` = '{$this->typeid}' {$arg['where']} ORDER BY `id` DESC limit $offset,$pagesize";
		$result = $this->_db->query($sql);
		while($row = $this->_db->fetch_array($result))
		{
			$row['addtime'] = date('Y-m-d' , $row['addtime']);
			if($row['paytime'] == '' || $row['paytime'] == '0')
            {
                $row['paytime'] = '';
            }
            else
            {
                $row['paytime'] = date('Y-m-d' , $row['paytime']);
            }
			$lists['info'][] = $row;
		}
		return $lists;
	}

	function view($id, $userid = null)
	{
		$list = array();
		if (empty($userid))
		{
			$sql = "SELECT * FROM `$this->table_amount` WHERE `id` = '$id' AND `type` = '{$this->typeid}' ";
		}
		else
		{
			$sql = "SELECT * FROM `$this->table_amount` WHERE `id` = '$id' AND `userid` = '{$userid}' AND `type` = '{$this->typeid}' ";
		}
		 $list = $this->_db->get_one($sql);
		 return $list;
	 }

	function drop($id ,$condition = null)
	{
		$query_in = $this->db_create_in($id);
		$arg['where'] = $this->_make_condition($condition);
		$sql = "DELETE FROM `$this->table_amount` WHERE `id` {$query_in} {$arg['where']} ";
		return $this->_db->query($sql);
	}

	function check($id, $data = array())
	{
		global $_userid,$_username;
		$data['inputerid']	= $_userid;
		$data['inputer']	= $_username;
		$data['paytime']	= TIME;
		$id = intval($id);
		if ($data['ispay'])
		{
			$module = 'pay'; $type= 'amount'; $note = '鐢ㄦ埛鍏呭

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -