time()], [['company', 'created_at', 'updated_at', 'status'], 'integer'], [['realname'], 'string', 'max' => 32], [['introduction'], 'string', 'max' => 255], [['status'], 'default', 'value' => self::STATUS_YES], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'company' => '公司ID', 'realname' => '名称', 'introduction' => '简介', 'created_at' => '创建时间', 'updated_at' => 'Updated At', 'status' => '状态', ]; } public function getUser(){ return $this->hasOne(User::className(),['id'=>'company']); } // public function getCompanyInfo(){ // return $this->hasOne(UserCompany::className(),['id'=>'company']); // } public function getImage(){ return $this->hasOne(ImageSource::className(),['topid'=>'id'])->where('type=:type AND status = :status',[':type'=>ImageSource::TYPE_MANAGER,':status'=>ImageSource::STATUS_YES]); } //相关的样板房、工地 public function getBuilding(){ return $this->hasMany(Building::className(),['manager_id'=>'id']); } }