我需要帮助,我有一个模型
/**
* This is the model class for table "student_attachment_details".
*
* @property integer $createdBy
* @property string $reg_no
* @property string $county_attached
* @property string $closest_town
* @property string $company_attached
* @property integer $company_phone_number
* @property string $is_assessed
* @property string $location_description
* @property integer $department_id
* @property string $allocated_staff_id
*/
class StudentAttachmentDetails extends \yii\db\ActiveRecord
{
但是当我尝试像这样查询模型时
$student_details = StudentAttachmentDetails::find()
->where(['allocated_staff_id'=>'no'])
->limit(1);
然后尝试使用此
获取值 $reg_no = $student_details->reg_no;
我收到此错误
Getting unknown property: yii\db\ActiveQuery::reg_no
我做错了什么?
答案 0 :(得分:1)