CREATE VIEW `v_noprovide` AS SELECT
*
FROM
tb_section
WHERE
provide = ‘0‘
CREATE VIEW `v_thismonth` AS SELECT
ts.userId AS id,
CONCAT(
‘thismonth:‘,
SUM(ts.amount),
‘yuan‘
) AS ‘thismonth‘
FROM
tb_section AS ts
WHERE
ts.yearMonth = DATE_FORMAT(NOW(), ‘%Y%m‘)
CREATE VIEW `v_lastmonth` AS SELECT
ts.userId AS id,
CONCAT(
‘lastmonth:‘,
SUM(ts.amount),
‘yuan‘
) AS ‘lastmonth‘
FROM
tb_section AS ts
WHERE
ts.yearMonth = DATE_FORMAT(
DATE_SUB(NOW(), INTERVAL 1 MONTH),
‘%Y%m‘
)
CREATE
VIEW `v_usermanage` AS
SELECT
u.id AS id,
u.email AS email,
u.`name` AS `name`,
CONCAT(