50], [['ip'], 'string', 'max' => 150], [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::class, 'targetAttribute' => ['user_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels(): array { return [ 'id' => '工单id', 'user_id' => '发起工单的用户id', 'title' => '工单标题', 'description' => '工单内容', 'status' => '工单状态', 'created_at' => '工单创建时间', 'updated_at' => '工单更新时间', 'ip' => 'ip地址', ]; } /** * Gets query for [[TicketReplies]]. * * @return ActiveQuery */ public function getTicketReplies(): ActiveQuery { return $this->hasMany(TicketReplies::class, ['ticket_id' => 'id']); } /** * Gets query for [[User]]. * * @return ActiveQuery */ public function getUser(): ActiveQuery { return $this->hasOne(User::class, ['id' => 'user_id']); } }