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

  1. mysql> DESC zbphp.com_account_log;  
  2. +--------------+-----------------------+------+-----+---------+----------------+  
  3. | Field        | Type                  | Null | Key | Default | Extra          |  
  4. +--------------+-----------------------+------+-----+---------+----------------+  
  5. | log_id       | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |  
  6. | user_id      | mediumint(8) unsigned | NO   | MUL | NULL    |                |  
  7. | user_money   | decimal(10,2)         | NO   |     | NULL    |                |  
  8. | frozen_money | decimal(10,2)         | NO   |     | NULL    |                |  
  9. | rank_points  | mediumint(9)          | NO   |     | NULL    |                |  
  10. | pay_points   | mediumint(9)          | NO   |     | NULL    |                |  
  11. | change_time  | int(10) unsigned      | NO   |     | NULL    |                |  
  12. | change_desc  | varchar(255)          | NO   |     | NULL    |                |  
  13. | change_type  | tinyint(3) unsigned   | NO   |     | NULL    |                |  
  14. +--------------+-----------------------+------+-----+---------+----------------+  
  15. rows in set (0.02 sec)  
  16. mysql>  
  17.   
  18. mysql> DESC zbphp.com_pay_log;  
  19. +--------------+------------------------+------+-----+---------+----------------+  
  20. | Field        | Type                   | Null | Key | Default | Extra|  
  21. +--------------+------------------------+------+-----+---------+----------------+  
  22. | log_id       | int(10) unsigned       | NO   | PRI | NULL    | auto_increment|  
  23. | order_id     | mediumint(8) unsigned  | NO   |     | 0       ||  
  24. | order_amount | decimal(10,2) unsigned | NO   |     | NULL    ||  
  25. | order_type   | tinyint(1) unsigned    | NO   |     | 0       ||  
  26. | is_paid      | tinyint(1) unsigned    | NO   |     | 0       ||  
  27. +--------------+------------------------+------+-----+---------+----------------+  
  28. rows in set (0.00 sec)  
  29.   
  30.   
  31. mysql> DESC zbphp.com_user_account;  
  32. +--------------+-----------------------+------+-----+---------+----------------+  
  33. | Field        | Type                  | Null | Key | Default | Extra          |  
  34. +--------------+-----------------------+------+-----+---------+----------------+  
  35. | id           | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |  
  36. | user_id      | mediumint(8) unsigned | NO   | MUL | 0       |                |  
  37. | admin_user   | varchar(255)          | NO   |     | NULL    |                |  
  38. | amount       | decimal(10,2)         | NO   |     | NULL    |                |  
  39. | add_time     | int(10)               | NO   |     | 0       |                |  
  40. | paid_time    | int(10)               | NO   |     | 0       |                |  
  41. | admin_note   | varchar(255)          | NO   |     | NULL    |                |  
  42. | user_note    | varchar(255)          | NO   |     | NULL    |                |  
  43. | process_type | tinyint(1)            | NO   |     | 0       |                |  
  44. | payment      | varchar(90)           | NO   |     | NULL    |                |  
  45. | is_paid      | tinyint(1)            | NO   | MUL | 0       |                |  
  46. | trade_no     | varchar(32)           | NO   | MUL | NULL    |                |  
  47. | trade_status | varchar(32)           | NO   | MUL | NULL    |                |  
  48. | ip           | varchar(15)           | NO   |     | NULL    |                |  
  49. | ippoz        | varchar(30)           | NO   |     | NULL    |                |  
  50. +--------------+-----------------------+------+-----+---------+----------------+  
  51. 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

posted @ 2018-05-11 13:28  paymob  阅读(1355)  评论(0编辑  收藏  举报