|
@@ -93,8 +93,9 @@ SELECT
|
|
|
cir.introduction AS introduction /* 个人简介 */,
|
|
|
cu.state AS coach_state /* 技师状态 */,
|
|
|
cir.state AS info_record_state /* 审核状态 */,
|
|
|
- cir.portrait_images AS avatar /* 头像图片 */,
|
|
|
+ cir.avatar AS avatar /* 头像图片 */,
|
|
|
cir.life_photos AS life_photos /* 生活照片数组 */,
|
|
|
+ cir.created_at AS created_at /* 申请时间 */,
|
|
|
cir.auditor AS auditor /* 审核人 */,
|
|
|
cir.audit_time AS audit_time /* 审核时间 */,
|
|
|
cir.audit_remark AS audit_remark /* 审核备注 */,
|
|
@@ -106,12 +107,12 @@ WHERE
|
|
|
cir.deleted_at IS NULL
|
|
|
AND cu.deleted_at IS NULL;
|
|
|
|
|
|
-/* 技师认证记录视图 */
|
|
|
-DROP VIEW IF EXISTS v_coach_auth_record;
|
|
|
+/* 技师资质认证记录视图 */
|
|
|
+DROP VIEW IF EXISTS v_coach_qual_record;
|
|
|
|
|
|
-CREATE VIEW v_coach_auth_record AS
|
|
|
+CREATE VIEW v_coach_qual_record AS
|
|
|
SELECT
|
|
|
- cqr.id AS qualification_record_id /* 资质证书记录ID */,
|
|
|
+ cqr.id AS id /* 资质证书记录ID */,
|
|
|
cu.id AS coach_id /* 技师ID */,
|
|
|
cir.id AS info_record_id /* 技师信息记录ID */,
|
|
|
cqr.qual_type AS qual_type /* 资质类型 */,
|
|
@@ -121,7 +122,7 @@ SELECT
|
|
|
cqr.state AS qualification_record_state /* 审核状态 */,
|
|
|
cir.nickname AS nickname /* 技师昵称 */,
|
|
|
cir.gender AS gender /* 技师性别 */,
|
|
|
- cir.mobile AS phone /* 技师手机号码 */,
|
|
|
+ cir.mobile AS mobile /* 技师手机号码 */,
|
|
|
cir.intention_city AS intention_city /* 技师期望城市 */,
|
|
|
cir.introduction AS introduction /* 技师个人简介 */,
|
|
|
cir.portrait_images AS avatar /* 头像图片 */,
|
|
@@ -131,6 +132,7 @@ SELECT
|
|
|
cr.id_card_front_photo AS id_card_front_photo /* 技师身份证照片正面 */,
|
|
|
cr.id_card_back_photo AS id_card_back_photo /* 技师身份证照片反面 */,
|
|
|
cr.id_card_hand_photo AS id_card_hand_photo /* 技师身份证手持照片 */,
|
|
|
+ cqr.created_at AS created_at /* 申请时间 */,
|
|
|
cqr.auditor AS auditor /* 审核人 */,
|
|
|
cqr.audit_time AS audit_time /* 审核时间 */,
|
|
|
cqr.audit_remark AS audit_remark /* 审核备注 */
|
|
@@ -138,8 +140,41 @@ FROM
|
|
|
coach_qual_records cqr
|
|
|
LEFT JOIN coach_users cu ON cu.id = cqr.coach_id /* 先关联技师用户表 */
|
|
|
LEFT JOIN coach_info_records cir ON cir.id = cu.info_record_id /* 再关联技师信息记录表 */
|
|
|
- LEFT JOIN coach_real_records cr ON cr.id = cu.real_auth_record_id /* 最后关联实名认证记录表 */
|
|
|
+ LEFT JOIN coach_real_records cr ON cr.coach_id = cqr.coach_id /* 最后关联实名认证记录表 */
|
|
|
WHERE
|
|
|
cqr.deleted_at IS NULL
|
|
|
AND cu.deleted_at IS NULL
|
|
|
AND cir.deleted_at IS NULL;
|
|
|
+
|
|
|
+/* 技师实名认证记录视图 */
|
|
|
+DROP VIEW IF EXISTS v_coach_real_record;
|
|
|
+
|
|
|
+CREATE VIEW v_coach_real_record AS
|
|
|
+SELECT
|
|
|
+ cr.id AS id /* 实名认证记录ID */,
|
|
|
+ cu.id AS coach_id /* 技师ID */,
|
|
|
+ cir.id AS info_record_id /* 技师信息记录ID */,
|
|
|
+ cir.nickname AS nickname /* 技师昵称 */,
|
|
|
+ cir.portrait_images AS avatar /* 头像图片 */,
|
|
|
+ cir.gender AS gender /* 技师性别 */,
|
|
|
+ cir.mobile AS mobile /* 技师手机号码 */,
|
|
|
+ cir.intention_city AS intention_city /* 技师期望城市 */,
|
|
|
+ cr.real_name AS real_name /* 真实姓名 */,
|
|
|
+ cr.id_card AS id_card /* 身份证号码 */,
|
|
|
+ cu.state AS coach_state /* 技师状态 */,
|
|
|
+ cr.state AS state /* 审核状态 */,
|
|
|
+ cr.id_card_front_photo AS id_card_front_photo /* 身份证照片正面 */,
|
|
|
+ cr.id_card_back_photo AS id_card_back_photo /* 身份证照片反面 */,
|
|
|
+ cr.id_card_hand_photo AS id_card_hand_photo /* 身份证手持照片 */,
|
|
|
+ cr.created_at AS created_at /* 申请时间 */,
|
|
|
+ cr.auditor AS auditor /* 审核人 */,
|
|
|
+ cr.audit_time AS audit_time /* 审核时间 */,
|
|
|
+ cr.audit_remark AS audit_remark /* 审核备注 */
|
|
|
+FROM
|
|
|
+ coach_real_records cr
|
|
|
+ LEFT JOIN coach_users cu ON cu.id = cr.coach_id
|
|
|
+ LEFT JOIN coach_info_records cir ON cir.id = cu.info_record_id
|
|
|
+WHERE
|
|
|
+ cr.deleted_at IS NULL
|
|
|
+ AND cu.deleted_at IS NULL
|
|
|
+ AND cir.deleted_at IS NULL;
|