有一个名为的表user_transaction
,其结构如下:
transaction_id mediumint(6) UNSIGNED (PK)
transaction_no varchar(55)
transaction_cc_avenue_no varchar(55)
transaction_card_category varchar(100)
transaction_user_id varchar(32)
transaction_user_name varchar(255)
transaction_user_email_id varchar(255)
transaction_deal_code varchar(10)
transaction_dc_id smallint(4)
transaction_amount float(10,2)
transaction_discount float(10,2)
transaction_total_amount float(10,2)
transaction_data_assign enum('0', '1')
transaction_status enum('success', 'inprocess', 'fail', 'cancelled')
transaction_date bigint(12)
transaction_update_date bigint(12)
transaction_update_user_id varchar(32)
我在字段中使用 UNIX 时间戳值transaction_date
并transaction_update_date
存储日期。现在我的问题是我从 PHP 的表单中以 dd/mm/yyyy say(11/07/2013) 格式获取今天的日期。得到这个日期后,我只想找出今天(即 11/07/2013)的以下计数:
total count of all the transactions carried out,
total count of all the transactions having transaction_status as 'success',
total count of all the transactions having transaction_status as 'inprocess',
total count of all the transactions having transaction_status as 'fail',
total count of all the transactions having transaction_status as 'cancelled'
两个日期也需要相同的输出(两个日期的范围,包括两个日期)。我是这个 UNIX 时间戳操作的新手。任何人都可以在这方面帮助我吗?提前致谢。