45], [['subfolder_name', 'user_agent'], 'string', 'max' => 255], [['note'], 'string', 'max' => 100], [['task_id'], 'exist', 'skipOnError' => true, 'targetClass' => CollectionTasks::class, 'targetAttribute' => ['task_id' => 'id']], [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::class, 'targetAttribute' => ['user_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels(): array { return [ 'id' => '上传记录id', 'user_id' => '用户ID', 'task_id' => '收集任务id', 'uploader_ip' => '上传者ip', 'uploaded_at' => '上传时间', 'subfolder_name' => '所在位置', 'user_agent' => '浏览器UA信息', 'note' => '用户设置的备注', ]; } /** * Gets query for [[Task]]. * * @return ActiveQuery */ public function getTask(): ActiveQuery { return $this->hasOne(CollectionTasks::class, ['id' => 'task_id']); } /** * Gets query for [[User]]. * * @return ActiveQuery */ public function getUser() { return $this->hasOne(User::class, ['id' => 'user_id']); } }