
-- --------------------------------------------------------

--
-- 表的结构 `zjr_cell_coin_trans`
--

CREATE TABLE `zjr_cell_coin_trans` (
  `TransId` bigint(20) UNSIGNED NOT NULL,
  `OkFlag` varchar(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `UserId` bigint(13) UNSIGNED NOT NULL,
  `TransTmk` datetime NOT NULL,
  `TransAmt` bigint(20) NOT NULL,
  `TransCat` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
  `RefId` bigint(20) UNSIGNED NOT NULL,
  `TransMemo` varchar(50) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='话费币交易记录';

--
-- 转存表中的数据 `zjr_cell_coin_trans`
--

INSERT INTO `zjr_cell_coin_trans` (`TransId`, `OkFlag`, `UserId`, `TransTmk`, `TransAmt`, `TransCat`, `RefId`, `TransMemo`) VALUES
(1, '0', 4308211020301, '2015-12-01 19:09:52', 2, '43', 0, '邀请好友系统奖励'),
(2, '0', 4308211020301, '2015-12-01 19:09:55', 2, '43', 0, '邀请好友系统奖励'),
(3, '0', 4308211020302, '2015-12-01 19:13:00', 2, '43', 0, '邀请好友系统奖励'),
(4, '0', 4308211020302, '2015-12-01 19:13:04', 2, '43', 0, '邀请好友系统奖励'),
(5, '0', 4308211020302, '2015-12-01 19:13:07', 2, '43', 0, '邀请好友系统奖励'),
(6, '0', 4308211020302, '2015-12-01 19:13:10', 2, '43', 0, '邀请好友系统奖励'),
(10, '0', 4308211020302, '2015-12-15 14:51:08', -1, '31', 0, '18666877608充值'),
(11, '0', 4308211020325, '2016-01-11 15:52:51', 5, '43', 0, '邀请好友系统奖励'),
(12, '0', 4308211020330, '2016-01-11 21:34:17', 5, '43', 0, '邀请好友系统奖励'),
(13, '0', 4308211020330, '2016-01-11 21:34:33', 5, '43', 0, '邀请好友系统奖励'),
(14, '0', 4308211020327, '2016-01-11 23:47:13', 5, '43', 0, '邀请好友系统奖励'),
(15, '0', 4308211020327, '2016-01-11 23:47:37', 5, '43', 0, '邀请好友系统奖励'),
(16, '0', 4308211020327, '2016-01-11 23:47:41', 5, '43', 0, '邀请好友系统奖励'),
(17, '0', 4308211020327, '2016-01-11 23:48:04', 5, '43', 0, '邀请好友系统奖励'),
(18, '0', 4308211020327, '2016-01-13 08:08:25', -20, '31', 0, '18874465091充值'),
(21, '0', 4308211020327, '2016-01-16 05:37:05', 5, '43', 0, '邀请好友系统奖励'),
(22, '0', 4308211020327, '2016-01-16 05:37:06', 5, '43', 0, '邀请好友系统奖励'),
(23, '0', 4308211020327, '2016-01-16 05:37:22', 5, '43', 0, '邀请好友系统奖励'),
(24, '0', 4308211020327, '2016-01-16 05:37:23', 5, '43', 0, '邀请好友系统奖励'),
(25, '0', 4308211020327, '2016-01-16 05:37:42', 5, '43', 0, '邀请好友系统奖励'),
(26, '0', 4308211020327, '2016-01-16 05:37:42', 5, '43', 0, '邀请好友系统奖励'),
(27, '0', 4308211020327, '2016-01-16 05:38:14', 5, '43', 0, '邀请好友系统奖励'),
(28, '0', 4308211020327, '2016-01-16 05:38:15', 5, '43', 0, '邀请好友系统奖励'),
(29, '0', 4308211020327, '2016-01-16 05:38:19', 5, '43', 0, '邀请好友系统奖励'),
(30, '0', 4308211020327, '2016-01-16 05:38:20', 5, '43', 0, '邀请好友系统奖励'),
(31, '0', 4308211020363, '2016-03-10 15:04:24', 0, '43', 0, '邀请好友系统奖励');

--
-- 触发器 `zjr_cell_coin_trans`
--
DELIMITER $$
CREATE TRIGGER `update_cell_coin` AFTER INSERT ON `zjr_cell_coin_trans` FOR EACH ROW begin
 update zjr_coin_balance set CellBal=CellBal+new.TransAmt where UserId=new.UserId;
end
$$
DELIMITER ;
