TP5在model使用select查询显示的数据问题

浏览:1849 发布日期:2018/07/17 分类:ThinkPHP5专区 关键字: TP5 model
我在model里使用 $data = $this->select();
为什么返回了很多没有必要的数据,
[0] => app\admin\model\User object
(
[pk:protected] => user_id
[resultSetType:protected] => collecton
[connection:protected] => Array
(
)

[parent:protected] =>
[query:protected] =>
[name:protected] => User
[table:protected] =>
[class:protected] => app\admin\model\User
[error:protected] =>
[validate:protected] =>
[field:protected] => Array
(
)

[except:protected] => Array
(
)

[disuse:protected] => Array
(
)

[readonly:protected] => Array
(
)

[visible:protected] => Array
(
)

[hidden:protected] => Array
(
)

[append:protected] => Array
(
)

[data:protected] => Array
(
[user_id] => 1
[user_login] => admin
[user_pass] => 123456
[user_nicename] => admin
[user_email] => admin@sina.com
[user_phone] => 15889745718
[user_registered] => 2018-07-17 15:35:05
[user_status] => 0
[user_role] => 1
)


我只需要数据表里有的字段就行了,怎么设置
最佳答案
评论( 相关
后面还有条评论,点击查看>>