/* 查询当前消息条数*/
SELECT COUNT(*) FROM ftxia_items
;
/查询商品明细 /
SELECT * FROM ftxia_items
;
/* 查询失效的 */
SELECT * FROM ftxia_items
WHERE id = ‘16754’;
/查询优惠劵金额为0的 /
SELECT COUNT(*) FROM ftxia_items
WHERE quan = ‘0’;
/* 查询结束时间小于系统当前时间的 */
SELECT COUNT(*) FROM ftxia_items
WHERE coupon_end_time <= ‘1481679180’;
/* 更新结束时间 */
UPDATE ftxia_items
SET coupon_end_time = ‘1481817600’ WHERE coupon_end_time <= ‘1481679180’;
/* 删除表数据 */
DELETE FROM ftxia_items
DROP TABLE IF EXISTS ftxia_items
;
CREATE TABLE ftxia_items
( id
INT(11) NOT NULL AUTO_INCREMENT, ordid
INT(11) DEFAULT ‘9999’ COMMENT ‘自定义排序’, cate_id
INT(11) DEFAULT ‘0’ COMMENT ‘属于分类’, orig_id
SMALLINT(6) DEFAULT ‘1’, num_iid
VARCHAR(12) NOT NULL, title
VARCHAR(255) NOT NULL, intro
VARCHAR(255) DEFAULT NULL, headPic
VARCHAR(255) DEFAULT NULL, feedback
VARCHAR(255) DEFAULT NULL, nicker
VARCHAR(255) DEFAULT NULL, nicker1
VARCHAR(255) DEFAULT NULL, feedback1
VARCHAR(255) DEFAULT NULL, headPic1
VARCHAR(255) DEFAULT NULL, nicker2
VARCHAR(255) DEFAULT NULL, feedback2
VARCHAR(255) DEFAULT NULL, headPic2
VARCHAR(255) DEFAULT NULL, nicker3
VARCHAR(255) DEFAULT NULL, feedback3
VARCHAR(255) DEFAULT NULL, headPic3
VARCHAR(255) DEFAULT NULL, nicker4
VARCHAR(255) DEFAULT NULL, feedback4
VARCHAR(255) DEFAULT NULL, headPic4
VARCHAR(255) DEFAULT NULL, desc
LONGTEXT, tags
VARCHAR(255) DEFAULT NULL, nick
VARCHAR(200) NOT NULL, sellerId
VARCHAR(11) DEFAULT NULL, uid
INT(10) UNSIGNED NOT NULL DEFAULT ‘1’, uname
VARCHAR(20) NOT NULL DEFAULT ‘admin’, pic_url
VARCHAR(200) NOT NULL, pic_urls
VARCHAR(200) DEFAULT NULL COMMENT ‘宽版图片’, price
DECIMAL(11,2) NOT NULL, click_url
TEXT, volume
INT(11) NOT NULL, commission
DECIMAL(11,2) NOT NULL, commission_rate
INT(11) NOT NULL, coupon_price
DECIMAL(11,2) NOT NULL, coupon_rate
INT(11) NOT NULL, coupon_start_time
INT(11) DEFAULT NULL, coupon_end_time
INT(11) DEFAULT NULL, pass
INT(11) DEFAULT ‘0’ COMMENT ‘是否审核’, status
VARCHAR(20) DEFAULT ‘underway’ COMMENT ‘出售状态’, fail_reason
VARCHAR(500) DEFAULT NULL COMMENT ‘未通过理由’, shop_type
VARCHAR(11) DEFAULT NULL, item_url
VARCHAR(500) DEFAULT NULL COMMENT ‘宝贝地址’, ems
INT(11) DEFAULT ‘0’, qq
VARCHAR(20) DEFAULT NULL, mobile
VARCHAR(13) DEFAULT ”, realname
VARCHAR(25) DEFAULT NULL, hits
INT(11) DEFAULT ‘0’ COMMENT ‘点击量’, isshow
INT(11) DEFAULT ‘1’, likes
INT(11) DEFAULT ‘0’, inventory
INT(11) DEFAULT ‘0’ COMMENT ‘库存’, seo_title
VARCHAR(255) DEFAULT NULL, seo_keys
VARCHAR(255) DEFAULT NULL, seo_desc
TEXT, add_time
INT(11) DEFAULT NULL, last_rate_time
INT(10) NOT NULL DEFAULT ‘0’, is_collect_comments
INT(1) DEFAULT ‘0’ COMMENT ‘是否采集了淘宝评论1表示已经采集了淘宝评论’, cu
VARCHAR(200) NOT NULL, sex
INT(1) NOT NULL DEFAULT ‘0’, isq
SMALLINT(1) NOT NULL DEFAULT ‘0’, quan
VARCHAR(50) NOT NULL, quanurl
TEXT NOT NULL, Quan_condition
VARCHAR(255) NOT NULL, Quan_surplus
INT(50) NOT NULL, Quan_receive
INT(50) NOT NULL, tokenlink
VARCHAR(20) NOT NULL,
PRIMARY KEY (id
),
UNIQUE KEY num_iid
(num_iid
),
KEY coupon_rate
(coupon_rate
),
KEY cate_id
(cate_id
),
KEY status
(status
),
KEY add_time
(add_time
),
KEY ordid
(ordid
),
KEY ordid_2
(ordid
,add_time
)
) ENGINE=MYISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;