swoft icon indicating copy to clipboard operation
swoft copied to clipboard

swoft模型查询数据问题

Open geekchenzx opened this issue 4 years ago • 6 comments

t通过模型查询出来的数据是小驼峰,能否可以取出下划线形式。如果不能建议添加这个,数据是驼峰很不友好

geekchenzx avatar May 20 '20 07:05 geekchenzx

getArrayableAttributes 这个方法就可以 不用 toArray

sakuraovq avatar May 21 '20 13:05 sakuraovq

getArrayableAttributes这个方法就可以不用 getArrayableAttributes这个方法就可以用模型查询出来的数据字段下划线?

geekchenzx avatar May 23 '20 12:05 geekchenzx

如果能在 php ./bin/swoft entity:create 中加个参数指定创建的entity字段prop是小驼峰(默认)或是下划线就完美了:)

suryluk avatar May 26 '20 04:05 suryluk

@chenzx023 是的你试试呢 getArrayableAttributes 查询出来是原始的数据库字段

sakuraovq avatar May 29 '20 06:05 sakuraovq

@sakuraovq 哦哦哦 还不如直接加个注解来控制 下划线或者是驼峰

geekchenzx avatar May 29 '20 09:05 geekchenzx

哈哈

sakuraovq avatar Jun 19 '20 09:06 sakuraovq