三表关联如果字段为0则表示是散客卡
select a.shop_id as id,b.shop_name,a.balance,a.point,
(IF(a.card_type_id<>0,concat(c.card_type,"(测试环境测试11)"),‘散客卡(测试环境测试11)‘)) as card from members a INNER JOIN
shops b on a.shop_id=b.id LEFT JOIN card_types c on a.card_type_id=c.id where a.mobile_phone=11111111111;
时间: 2024-10-26 01:31:32