douping1581 2018-08-16 09:47
浏览 9

显示公寓成员使用CI

I'm new for CI, I'm had 2 table calls 'partment' and 'user'. I try to display parment_name where brand_id column = 0 in Partment table and member name in User table, but in partment table i have 2 column is partment_id and brand_id, any partment have brand_id = 0 is the brand, any partment have brand_id = other partment_id excerpt it and unlike 0 is the partment. But user table just only have partment_id, so how show all value user in the Brand, but not show name of the Partment
Sorry for my bad English

Partment Table

+-------------+--------------+----------+
| partment_id | parment_name | brand_id |
+-------------+--------------+----------+
|           1 | brand 1      |        0 |
|           2 | partment 1   |        1 |
+-------------+--------------+----------+

User Table

+---------+--------+-------------+
| user_id |  name  | partment_id |
+---------+--------+-------------+
|       1 | name 1 |           2 |
|       2 | name 2 |           1 |
+---------+--------+-------------+

i want show like this:
|   brand 1  |
|   name 1  |
|   name 2  |

Thanks all Guys!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题