$model = new AdminUser();
// 查找admin_user的id,$project_id有值
$ids = $model->find(array(
'select' => 'id',
'condition' => 'project_id =' . $project_id
));
file_put_contents('./ids.txt', json_encode($ids)."\r\n",FILE_APPEND);
class AdminUserData extends CActiveRecord{}
打印的结果是模型自定义的属性,rules(),tablename(),mode()方法都有
class AdminUser extends AdminUserData
{
public $pre_password;
public $confirm_password;
public $role_name;
public $itemname;
public static $isDisabledSet = array('0' => "启用", '1' => "禁用");
public $member_count;
public $not_id;
public $role_arr;
public $keyword;
}
打印结果
{"pre_password":null,"confirm_password":null,"role_name":null,"itemname":null,"member_count":null,"not_id":null,"role_arr":null,"keyword":null}
为什么没有去查数据库的记录?
大幅度大幅度发