为什么我通过Model模型查询出来的数据都是受保护的?

浏览:1022 发布日期:2016/10/17 分类:ThinkPHP5专区 关键字: 模型查询
<?php
namespace app\admin\model;
use think\Model;
use think\Session;

class User extends Model{
//获取用户
public function getUser(){
echo "<pre>";
var_dump($this->select());
echo "</pre>";
}
}

//结果
array(8) {
[0]=>
object(app\admin\model\User)#15 (26) {
["connection":protected]=>
array(0) {
}
["name":protected]=>
string(4) "User"
["table":protected]=>
NULL
["class":protected]=>
string(20) "app\admin\model\User"
["error":protected]=>
NULL
["validate":protected]=>
NULL
["pk":protected]=>
NULL
["field":protected]=>
array(0) {
}
["readonly":protected]=>
array(0) {
}
["visible":protected]=>
array(0) {
}
["hidden":protected]=>
array(0) {
}
["append":protected]=>
array(0) {
}
["data":protected]=>
array(9) {
["id"]=>
int(22)
["user"]=>
string(4) "houn"
["name"]=>
string(0) ""
["password"]=>
string(32) "65b50b04a6af50bb2f174db30a8c6dad"
["note"]=>
string(0) ""
["pid"]=>
int(0)
["company"]=>
string(0) ""
["address"]=>
string(0) ""
["tel"]=>
int(0)
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>