ECSHOP account_log,pay_log,user_account 三个表的用途与区别

mysql> DESC zbphp.com_account_log;
+--------------+-----------------------+------+-----+---------+----------------+
| Field        | Type                  | Null | Key | Default | Extra          |
+--------------+-----------------------+------+-----+---------+----------------+
| log_id       | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |
| user_id      | mediumint(8) unsigned | NO   | MUL | NULL    |                |
| user_money   | decimal(10,2)         | NO   |     | NULL    |                |
| frozen_money | decimal(10,2)         | NO   |     | NULL    |                |
| rank_points  | mediumint(9)          | NO   |     | NULL    |                |
| pay_points   | mediumint(9)          | NO   |     | NULL    |                |
| change_time  | int(10) unsigned      | NO   |     | NULL    |                |
| change_desc  | varchar(255)          | NO   |     | NULL    |                |
| change_type  | tinyint(3) unsigned   | NO   |     | NULL    |                |
+--------------+-----------------------+------+-----+---------+----------------+
9 rows in set (0.02 sec)
mysql>

mysql> DESC zbphp.com_pay_log;
+--------------+------------------------+------+-----+---------+----------------+
| Field        | Type                   | Null | Key | Default | Extra|
+--------------+------------------------+------+-----+---------+----------------+
| log_id       | int(10) unsigned       | NO   | PRI | NULL    | auto_increment|
| order_id     | mediumint(8) unsigned  | NO   |     | 0       ||
| order_amount | decimal(10,2) unsigned | NO   |     | NULL    ||
| order_type   | tinyint(1) unsigned    | NO   |     | 0       ||
| is_paid      | tinyint(1) unsigned    | NO   |     | 0       ||
+--------------+------------------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)


mysql> DESC zbphp.com_user_account;
+--------------+-----------------------+------+-----+---------+----------------+
| Field        | Type                  | Null | Key | Default | Extra          |
+--------------+-----------------------+------+-----+---------+----------------+
| id           | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |
| user_id      | mediumint(8) unsigned | NO   | MUL | 0       |                |
| admin_user   | varchar(255)          | NO   |     | NULL    |                |
| amount       | decimal(10,2)         | NO   |     | NULL    |                |
| add_time     | int(10)               | NO   |     | 0       |                |
| paid_time    | int(10)               | NO   |     | 0       |                |
| admin_note   | varchar(255)          | NO   |     | NULL    |                |
| user_note    | varchar(255)          | NO   |     | NULL    |                |
| process_type | tinyint(1)            | NO   |     | 0       |                |
| payment      | varchar(90)           | NO   |     | NULL    |                |
| is_paid      | tinyint(1)            | NO   | MUL | 0       |                |
| trade_no     | varchar(32)           | NO   | MUL | NULL    |                |
| trade_status | varchar(32)           | NO   | MUL | NULL    |                |
| ip           | varchar(15)           | NO   |     | NULL    |                |
| ippoz        | varchar(30)           | NO   |     | NULL    |                |
+--------------+-----------------------+------+-----+---------+----------------+
15 rows in set (0.00 sec)


数据库中涉及充值的三个表: account_log,pay_log,user_account


account_log -- 存放用户充值/提现响应记录  变更记录

涉及的操作函数:

1) log_account_change()  更改会员信息

2) get_user_surplus()查询会员余额总数

 

pay_log  -- 存放支付记录 包括充值 付款 提款

1)insert_pay_log() 插入付款记录

2)get_paylog_id() 获得付款信息的记录

 

user_account --  会员充值/提现申请记录

涉及的函数:

1)insert_user_account() 插入记录

2)update_user_account() 更新账目明细

3)get_surplus_info() 获得

4)get_account_log() 获得,更详尽

5)del_user_account() 删除


其他字段

users.user_money
users.frozen_money



你可能感兴趣的:(PHP有关)