-- Active: xiaoding_test@@192.168.110.85@3306@xiaoding_test
DROP TABLE IF EXISTS report_project_list;

CREATE TABLE report_project_list AS
/* 项目列表视图 */

DROP VIEW IF EXISTS manage_project_list;

CREATE OR REPLACE VIEW manage_project_list AS
SELECT p.id /* 项目编号 */, p.title /* 项目名称 */, pc.name /* 项目分类名称 */, p.price /* 项目价格 */, p.duration /* 服务时长(分钟) */, p.state /* 状态 */, p.cover /* 项目封面图片 */
FROM
    project p /* 项目表 */
    LEFT JOIN project_cate pc /* 项目分类表 */ ON p.cate_id = pc.id
    AND pc.deleted_at IS NULL
WHERE
    p.deleted_at IS NULL
ORDER BY p.id DESC;
