[self::TYPE_COMPANY,self::TYPE_CLIENT]], [['uid', 'created_at', 'status', 'state', 'updated_at','type'], 'integer'], [['content', 'remark','author'], 'string'], [['contact'], 'string', 'max' => 120], [['created_at','updated_at'], 'default', 'value' => time()], [['status'], 'default', 'value' => self::STATUS_ACTIVE], [['state'], 'default', 'value' => self::STATE_WAIT], [['uid'], 'default', 'value' => Yii::$app->user->id], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'uid' => '用户ID', 'contact' => '联系方式', 'content' => '内容', 'created_at' => '创建时间', 'status' => '状态', 'state' => '处理状态', 'updated_at' => '最后处理时间', 'author' => '处理人', 'remark' => '备注', 'type' => 'type', ]; } public function getUserInfo(){ return $this->hasOne(User::className(),['id'=>'uid']); } public function getAdminUser(){ return $this->hasOne(AdminUser::className(),['id'=>'author']); } }