150], [['ticket_id'], 'exist', 'skipOnError' => true, 'targetClass' => Tickets::class, 'targetAttribute' => ['ticket_id' => 'id']], [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::class, 'targetAttribute' => ['user_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels(): array { return [ 'id' => '工单消息id', 'ticket_id' => '归属的工单id', 'user_id' => '消息发送者id', 'message' => '消息内容', 'created_at' => '发送时间', 'ip' => 'ip地址', ]; } /** * Gets query for [[Ticket]]. * * @return ActiveQuery */ public function getTicket(): ActiveQuery { return $this->hasOne(Tickets::class, ['id' => 'ticket_id']); } /** * Gets query for [[User]]. * * @return ActiveQuery */ public function getUser(): ActiveQuery { return $this->hasOne(User::class, ['id' => 'user_id']); } }