$category = (new Query())->select(['c.id'])
->from(Category::tableName().' c')
->innerJoin(UserCategory::tableName().' uc','uc.category_id = c.id')
->where(['uc.user_id' => Yii::$app->user->id,'c.name' => $name,'uc.del' => 1]);
$update = (new Query())->createCommand()->update('user_category',['del' => 0],['category_id' => $category])->execute();