Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
S
shuidi-product-change
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • 互联网应用开发
  • shuidi-product-change
  • Issues
  • #1

Closed
Open
Created Feb 14, 2017 by 互联网应用开发@wangqsMaintainer

建表tb_user_order

数据库:ucs

表名:tb_user_order

sql:

CREATE TABLE `tb_user_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `order_no` varchar(64) NOT NULL COMMENT '订单号',
  `type` varchar(64) NOT NULL COMMENT '订单类型',
  `assoc_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '关联的id',
  `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态 0 待支付 1 支付成功 2 支付失败 3 删除',
  `pay_time` int(11) NOT NULL DEFAULT '0' COMMENT '支付成功时间',
  `add_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `lastupdatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_no` (`order_no`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='用户订单'

涉及的查询语句

select * from tb_user_order  where user_id =? and type=? and pay_time>=?
select * from tb_user_order where order_no=?
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking